mailing list of musl libc
 help / color / mirror / code / Atom feed
* Bug in include/netinet/in.h
@ 2013-01-23 16:39 Alexander Stadler
  2013-01-23 16:58 ` John Spencer
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stadler @ 2013-01-23 16:39 UTC (permalink / raw)
  To: musl

Dear musl developers!

I currently try to compile openwrt with your library instead of with uClibc.

Since recent changes in the netifd code, I get the following error:

make[6]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1'
Scanning dependencies of target netifd
make[6]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1'
make[6]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1'
[  5%] Building C object CMakeFiles/netifd.dir/main.c.o
[ 11%] Building C object CMakeFiles/netifd.dir/utils.c.o
[ 17%] Building C object CMakeFiles/netifd.dir/system.c.o
[ 23%] Building C object CMakeFiles/netifd.dir/tunnel.c.o
[ 29%] Building C object CMakeFiles/netifd.dir/interface.c.o
[ 35%] Building C object CMakeFiles/netifd.dir/interface-ip.c.o
/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c: In function 'interface_ip_set_ula_prefix':
/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
cc1: all warnings being treated as errors
make[6]: *** [CMakeFiles/netifd.dir/interface-ip.c.o] Error 1
make[6]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1'

As this line does not have an | operation in it, but IN6_ARE_ADDR_EQUAL
http://git.musl-libc.org/cgit/musl/tree/include/netinet/in.h#n148
has, we think its a bug on your side.

The ticket in openwrt was
https://dev.openwrt.org/ticket/12871

Thanks

Alex


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

* Re: Bug in include/netinet/in.h
  2013-01-23 16:39 Bug in include/netinet/in.h Alexander Stadler
@ 2013-01-23 16:58 ` John Spencer
  2013-01-23 17:08   ` Alexander Stadler
  2013-01-23 17:11   ` Rich Felker
  0 siblings, 2 replies; 11+ messages in thread
From: John Spencer @ 2013-01-23 16:58 UTC (permalink / raw)
  To: sa.musl; +Cc: musl

On 01/23/2013 05:39 PM, Alexander Stadler wrote:
> [-Werror=parentheses]
> /space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
> cc1: all warnings being treated as errors
the bug here is -Werror being passed to the compiler, try adding 
--disable-werror to the configure invocation

(note: using -Werror by default is pretty inept, since it will cause 
build errors on any compiler/libc combination that has not yet been 
tested by the package author)


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

* Re: Bug in include/netinet/in.h
  2013-01-23 16:58 ` John Spencer
@ 2013-01-23 17:08   ` Alexander Stadler
  2013-01-23 17:11   ` Rich Felker
  1 sibling, 0 replies; 11+ messages in thread
From: Alexander Stadler @ 2013-01-23 17:08 UTC (permalink / raw)
  To: John Spencer; +Cc: musl

Am 23.01.2013 17:58, schrieb John Spencer:
> On 01/23/2013 05:39 PM, Alexander Stadler wrote:
>> [-Werror=parentheses]
>> /space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
>> cc1: all warnings being treated as errors
> the bug here is -Werror being passed to the compiler, try adding --disable-werror to the configure invocation
> 
> (note: using -Werror by default is pretty inept, since it will cause build errors on any compiler/libc combination that has not yet been tested by the package author)

Thanks for your fast response.

I'll try that, but a really big part of the code compiled through, so don't you think that this specific problem is one which could be optimized to not throw anything?


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

* Re: Bug in include/netinet/in.h
  2013-01-23 16:58 ` John Spencer
  2013-01-23 17:08   ` Alexander Stadler
@ 2013-01-23 17:11   ` Rich Felker
  2013-01-24 19:22     ` Alexander Stadler
  1 sibling, 1 reply; 11+ messages in thread
From: Rich Felker @ 2013-01-23 17:11 UTC (permalink / raw)
  To: musl

On Wed, Jan 23, 2013 at 05:58:13PM +0100, John Spencer wrote:
> On 01/23/2013 05:39 PM, Alexander Stadler wrote:
> >[-Werror=parentheses]
> >/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
> >cc1: all warnings being treated as errors
> the bug here is -Werror being passed to the compiler, try adding
> --disable-werror to the configure invocation
> 
> (note: using -Werror by default is pretty inept, since it will cause
> build errors on any compiler/libc combination that has not yet been
> tested by the package author)

Normally these kind of warnings are ignored in the system headers and
macro text expanded from macros defined in the system headers. I don't
see any reason we can't "fix" this particular macro however if for
some reason it's still making trouble..

Rich


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

* Re: Bug in include/netinet/in.h
  2013-01-23 17:11   ` Rich Felker
@ 2013-01-24 19:22     ` Alexander Stadler
  2013-01-24 20:38       ` Rich Felker
  2013-01-24 20:46       ` John Spencer
  0 siblings, 2 replies; 11+ messages in thread
From: Alexander Stadler @ 2013-01-24 19:22 UTC (permalink / raw)
  To: musl

Am 23.01.2013 18:11, schrieb Rich Felker:
> On Wed, Jan 23, 2013 at 05:58:13PM +0100, John Spencer wrote:
>> On 01/23/2013 05:39 PM, Alexander Stadler wrote:
>>> [-Werror=parentheses]
>>> /space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
>>> cc1: all warnings being treated as errors
>> the bug here is -Werror being passed to the compiler, try adding
>> --disable-werror to the configure invocation
>>
>> (note: using -Werror by default is pretty inept, since it will cause
>> build errors on any compiler/libc combination that has not yet been
>> tested by the package author)
> 
> Normally these kind of warnings are ignored in the system headers and
> macro text expanded from macros defined in the system headers. I don't
> see any reason we can't "fix" this particular macro however if for
> some reason it's still making trouble..
> 
> Rich

I removed -Werror from CMakeLists.txt of netifd, after that it compiled (with warnings ;-) ).
Thank you!

(only size shocked me - 450KB (one day before with uClibc 50KB :-/ ))


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

* Re: Bug in include/netinet/in.h
  2013-01-24 19:22     ` Alexander Stadler
@ 2013-01-24 20:38       ` Rich Felker
  2013-01-24 20:46       ` John Spencer
  1 sibling, 0 replies; 11+ messages in thread
From: Rich Felker @ 2013-01-24 20:38 UTC (permalink / raw)
  To: musl

On Thu, Jan 24, 2013 at 08:22:03PM +0100, Alexander Stadler wrote:
> Am 23.01.2013 18:11, schrieb Rich Felker:
> > On Wed, Jan 23, 2013 at 05:58:13PM +0100, John Spencer wrote:
> >> On 01/23/2013 05:39 PM, Alexander Stadler wrote:
> >>> [-Werror=parentheses]
> >>> /space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/netifd-2013-01-22.1/interface-ip.c:655:2: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
> >>> cc1: all warnings being treated as errors
> >> the bug here is -Werror being passed to the compiler, try adding
> >> --disable-werror to the configure invocation
> >>
> >> (note: using -Werror by default is pretty inept, since it will cause
> >> build errors on any compiler/libc combination that has not yet been
> >> tested by the package author)
> > 
> > Normally these kind of warnings are ignored in the system headers and
> > macro text expanded from macros defined in the system headers. I don't
> > see any reason we can't "fix" this particular macro however if for
> > some reason it's still making trouble..
> > 
> > Rich
> 
> I removed -Werror from CMakeLists.txt of netifd, after that it compiled (with warnings ;-) ).
> Thank you!
> 
> (only size shocked me - 450KB (one day before with uClibc 50KB :-/ ))

You must have been dynamic linking with uClibc and static linking with
musl -- and linking some libs other than just libc statically, I
think, since even the whole libc is not that big.

Rich


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

* Re: Bug in include/netinet/in.h
  2013-01-24 19:22     ` Alexander Stadler
  2013-01-24 20:38       ` Rich Felker
@ 2013-01-24 20:46       ` John Spencer
  2013-01-29 17:37         ` Alexander Stadler
  1 sibling, 1 reply; 11+ messages in thread
From: John Spencer @ 2013-01-24 20:46 UTC (permalink / raw)
  To: musl

On 01/24/2013 08:22 PM, Alexander Stadler wrote:
>
> I removed -Werror from CMakeLists.txt of netifd, after that it compiled (with warnings ;-) ).
> Thank you!
>
> (only size shocked me - 450KB (one day before with uClibc 50KB :-/ ))
>
probably something went wrong here, usually musl-linked binaries are a 
good bit smaller than their uclibc-linked counterparts.
some guesses:
- uclibc binary is linked dynamically, but the musl one statically
- debug mode (-g) was used for the musl binary
- uclibc binary was stripped (-s) but musl one wasn't

i'd try to use strip tool on both binaries and compare
additionally comparing the used CFLAGS used by the compiler might give 
hints (compile both in verbose mode and compare build logs)
for smallest binary size, usually -flto -fwhole-program -s -Os give the 
best results with gcc >= 4.5.0 (however lto makes the build notably slower)



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

* Re: Bug in include/netinet/in.h
  2013-01-24 20:46       ` John Spencer
@ 2013-01-29 17:37         ` Alexander Stadler
  2013-01-29 18:10           ` Szabolcs Nagy
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stadler @ 2013-01-29 17:37 UTC (permalink / raw)
  To: musl

Am 24.01.2013 21:46, schrieb John Spencer:
> On 01/24/2013 08:22 PM, Alexander Stadler wrote:
>>
>> I removed -Werror from CMakeLists.txt of netifd, after that it compiled (with warnings ;-) ).
>> Thank you!
>>
>> (only size shocked me - 450KB (one day before with uClibc 50KB :-/ ))
>>
> probably something went wrong here, usually musl-linked binaries are a good bit smaller than their uclibc-linked counterparts.
> some guesses:
> - uclibc binary is linked dynamically, but the musl one statically
> - debug mode (-g) was used for the musl binary
> - uclibc binary was stripped (-s) but musl one wasn't
> 
> i'd try to use strip tool on both binaries and compare
> additionally comparing the used CFLAGS used by the compiler might give hints (compile both in verbose mode and compare build logs)
> for smallest binary size, usually -flto -fwhole-program -s -Os give the best results with gcc >= 4.5.0 (however lto makes the build notably slower)
> 

Thanks for the answer.
And the optimization parameters, I propably will play with them at some time.

https://dev.openwrt.org/changeset/34427
disables sstrip when musl is used,
but does not select strip instead. 
Unfortunately I don't know why sstrip got disabled.

But after enabling strip instead the size reaches comparable values (same too a bit larger most of the time).


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

* Re: Bug in include/netinet/in.h
  2013-01-29 17:37         ` Alexander Stadler
@ 2013-01-29 18:10           ` Szabolcs Nagy
  2013-01-29 18:33             ` Alexander Stadler
  0 siblings, 1 reply; 11+ messages in thread
From: Szabolcs Nagy @ 2013-01-29 18:10 UTC (permalink / raw)
  To: musl

* Alexander Stadler <sa.musl@univie.ac.at> [2013-01-29 18:37:54 +0100]:
> https://dev.openwrt.org/changeset/34427
> disables sstrip when musl is used,
> but does not select strip instead. 
> Unfortunately I don't know why sstrip got disabled.
> 

i've set a mail to openwrt-devel about this
in case they are not reading it here

it would be iteresting to see how well musl
works on openwrt..
are you using a real device or qemu?



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

* Re: Bug in include/netinet/in.h
  2013-01-29 18:10           ` Szabolcs Nagy
@ 2013-01-29 18:33             ` Alexander Stadler
  2013-01-29 20:36               ` Florian Fainelli
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander Stadler @ 2013-01-29 18:33 UTC (permalink / raw)
  To: musl

Am 29.01.2013 19:10, schrieb Szabolcs Nagy:
> * Alexander Stadler <sa.musl@univie.ac.at> [2013-01-29 18:37:54 +0100]:
>> https://dev.openwrt.org/changeset/34427
>> disables sstrip when musl is used,
>> but does not select strip instead. 
>> Unfortunately I don't know why sstrip got disabled.
>>
> 
> i've set a mail to openwrt-devel about this
> in case they are not reading it here
> 
> it would be iteresting to see how well musl
> works on openwrt..
> are you using a real device or qemu?

Nbd already added the strip change :-).
I haven't compiled through by now.
All problems currently are in:
https://dev.openwrt.org/ticket/12651
(don't want to spam on the list here too much..)
Florian wrote it didn't work on qemu, so if I compile through at some time.. I decide if I want to try a real device.


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

* Re: Bug in include/netinet/in.h
  2013-01-29 18:33             ` Alexander Stadler
@ 2013-01-29 20:36               ` Florian Fainelli
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2013-01-29 20:36 UTC (permalink / raw)
  To: musl; +Cc: Alexander Stadler

Le mardi 29 janvier 2013 19:33:23, Alexander Stadler a écrit :
> Am 29.01.2013 19:10, schrieb Szabolcs Nagy:
> > * Alexander Stadler <sa.musl@univie.ac.at> [2013-01-29 18:37:54 +0100]:
> >> https://dev.openwrt.org/changeset/34427
> >> disables sstrip when musl is used,
> >> but does not select strip instead.
> >> Unfortunately I don't know why sstrip got disabled.
> > 
> > i've set a mail to openwrt-devel about this
> > in case they are not reading it here
> > 
> > it would be iteresting to see how well musl
> > works on openwrt..
> > are you using a real device or qemu?
> 
> Nbd already added the strip change :-).
> I haven't compiled through by now.
> All problems currently are in:
> https://dev.openwrt.org/ticket/12651
> (don't want to spam on the list here too much..)
> Florian wrote it didn't work on qemu, so if I compile through at some
> time.. I decide if I want to try a real device.

I tested it successfully using the OpenWrt realview target under Qemu, I had 
issues with MIPS but that was due to the fact that we disable the in-kernel 
FPU emulator.

When I did the initial qemu testing I disabled all packages that did not 
compile with musl for various reasons. Note that these targets do not have any 
of the networking packages (ppp, iptables ...) enabled by default.
-- 
Florian


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

end of thread, other threads:[~2013-01-29 20:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 16:39 Bug in include/netinet/in.h Alexander Stadler
2013-01-23 16:58 ` John Spencer
2013-01-23 17:08   ` Alexander Stadler
2013-01-23 17:11   ` Rich Felker
2013-01-24 19:22     ` Alexander Stadler
2013-01-24 20:38       ` Rich Felker
2013-01-24 20:46       ` John Spencer
2013-01-29 17:37         ` Alexander Stadler
2013-01-29 18:10           ` Szabolcs Nagy
2013-01-29 18:33             ` Alexander Stadler
2013-01-29 20:36               ` Florian Fainelli

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).