mailing list of musl libc
 help / color / mirror / code / Atom feed
* clang/musl progress and a small bug.
@ 2012-05-25 21:40 Richard Pennington
  2012-05-25 23:17 ` Rich Felker
  2012-05-26 10:28 ` aep
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Pennington @ 2012-05-25 21:40 UTC (permalink / raw)
  To: musl

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-26 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-25 21:40 clang/musl progress and a small bug Richard Pennington
2012-05-25 23:17 ` Rich Felker
2012-07-26 18:24   ` John Spencer
2012-05-26 10:28 ` aep

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).