mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Richard Pennington <rich@pennware.com>
To: musl@lists.openwall.com
Subject: clang/musl progress and a small bug.
Date: Fri, 25 May 2012 16:40:51 -0500	[thread overview]
Message-ID: <4797553.4BPKurOpfG@main.pennware.com> (raw)

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




             reply	other threads:[~2012-05-25 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 21:40 Richard Pennington [this message]
2012-05-25 23:17 ` Rich Felker
2012-07-26 18:24   ` John Spencer
2012-05-26 10:28 ` aep

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4797553.4BPKurOpfG@main.pennware.com \
    --to=rich@pennware.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).