From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/911 Path: news.gmane.org!not-for-mail From: Richard Pennington Newsgroups: gmane.linux.lib.musl.general Subject: clang/musl progress and a small bug. Date: Fri, 25 May 2012 16:40:51 -0500 Message-ID: <4797553.4BPKurOpfG@main.pennware.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: dough.gmane.org 1337982125 30184 80.91.229.3 (25 May 2012 21:42:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 May 2012 21:42:05 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-912-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 25 23:42:04 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SY2Go-0005Kl-QF for gllmg-musl@plane.gmane.org; Fri, 25 May 2012 23:42:02 +0200 Original-Received: (qmail 11488 invoked by uid 550); 25 May 2012 21:42:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11480 invoked from network); 25 May 2012 21:42:02 -0000 X-Authority-Analysis: v=2.0 cv=cssZYiEi c=1 sm=0 a=/l7PkcR/UKDnn7Q2wmGJww==:17 a=hdNgKtvFP3AA:10 a=fR_ARpL9IlcA:10 a=cX4e7RL8OTgA:10 a=msTO8fkKGJEA:10 a=kj9zAlcOel0A:10 a=N4Ps669bAAAA:8 a=FrT742EqYUXQ4J00ACoA:9 a=CjuIK1q_8ugA:10 a=/l7PkcR/UKDnn7Q2wmGJww==:117 X-Cloudmark-Score: 0 X-Originating-IP: 65.26.59.215 User-Agent: KMail/4.8.3 (Linux/3.3.2-6.fc16.x86_64; KDE/4.8.3; x86_64; ; ) Xref: news.gmane.org gmane.linux.lib.musl.general:911 Archived-At: Hi, clang's libcompiler-rt doesn't have support for crtbegin.o and crtend.o so global constructors and destructors didn't work out of the box. If I link with the NetBSD versions of crtbegin.c and crtend.c in place of the musl crti.s and crtn.s everything works fine. For now, I've added them to the musl build under crt. I think I found a bug while running my library regression test. The zero test failed in the following code: TEST_TRACE(C99 7.20.3.1) p = calloc(100, sizeof(char)); TEST(p != NULL, "calloc() returned a pointer"); int flag = 1; for (i = 0; i < 100; ++i) { if (p[i] != 0) { flag = 0; } } TEST(flag, "calloc() returned zeroed memory"); The TEST() macro is kind of like assert but it prints out the message and counts failures and successes: PASS: 001stdlib.c:74: Stdlib(Stdlib): calloc() returned a pointer FAIL: 001stdlib.c:81: Stdlib(Stdlib): calloc() returned zeroed memory Stdlib unit tests completed 32 tests run 1 test failed Am I missing something? -Rich