Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+jXYnTfrqb6qujEtA1r8PyMu2z-k5+Qw+dG5dh-xYFvrRi2ww@mail.gmail.com>
Date: Wed, 6 Jul 2016 18:47:57 +0100
From: Aidan Hobson Sayers <aidanhs@...tab.net>
To: musl@...ts.openwall.com
Subject: Re: Re: [PATCH 1/1] Use compiler includes for musl-clang, like musl-gcc

```
/tmp/tmp.C3EY2NIDbS $ cat x.c
#include <unwind.h>
#include <stddef.h>
int main() {}
/tmp/tmp.C3EY2NIDbS $ ./musl/prefix/bin/musl-clang -E x.c | grep stddef
clang: warning: argument unused during compilation: '-static-libgcc'
clang: warning: argument unused during compilation: '-L-user-start'
clang: warning: argument unused during compilation:
'-L/tmp/tmp.C3EY2NIDbS/musl/prefix/lib'
clang: warning: argument unused during compilation: '-L-user-end'
# 1 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 1 3
# 17 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 3
# 18 "/tmp/tmp.C3EY2NIDbS/musl/prefix/include/stddef.h" 2 3
```

On 6 July 2016 at 18:44, Rich Felker <dalias@...c.org> wrote:

> On Wed, Jul 06, 2016 at 06:22:05PM +0100, Aidan Hobson Sayers wrote:
> > #include <unwind.h>
> > int main() {}
> >
> > The above currently compiles with musl-gcc but not with musl-clang. This
> > patch fixes the latter.
> >
> > ---
> >  tools/musl-clang.in | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/musl-clang.in b/tools/musl-clang.in
> > index 623de6f..0018932 100644
> > --- a/tools/musl-clang.in
> > +++ b/tools/musl-clang.in
> > @@ -24,7 +24,7 @@ exec $cc \
> >      -B"$thisdir" \
> >      -fuse-ld=musl-clang \
> >      -static-libgcc \
> > -    -nostdinc \
> > +    -nostdlibinc \
> >      --sysroot "$libc" \
> >      -isystem "$libc_inc" \
> >      -L-user-start \
> > --
>
> What happens when you #include <stddef.h> after making this change? Do
> you get the compiler-provided one or musl's? You should be able to
> tell by running musl-clang -E foo.c
>
> Rich
>



-- 
Aidan

Co-authored a book on Docker
<http://manning.com/miell/?a_aid=aidanhs&a_bid=e0d48f62> - get 39% off with
the code 39miell

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.