Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 9 Nov 2013 05:02:52 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Cc: Gregor Richards <gr@...due.edu>
Subject: Re: Latest pkgsrc results [What builds on musl 0.9.13?]

* Rich Felker <dalias@...ifal.cx> [2013-11-08 20:01:30 -0500]:
> > top missing symbols (compile or link time):
> > 
> > libintl_*
> > 	postgres*-client, libmusicbrainz5, weechat-curses, scmxx, scmgit-base,..
> 
> Which symbols? glibc doesn't seem to have any symbols matching
> libintl_*.

these are the gettext symbols (libintl_dgettext etc)
for some reason they are without prefix in the libc
but you can get them with prefix as well with -lintl

i assume this is some configure or pkgsrc failure
to set up the link flags or the include paths
(i assume there is a libintl.h that adds the prefix
with macro hackery and one that doesnt and they are
used inconsistently with the link flags)

btw the symbol failures were based on about 40% of the
pkgsrc logs but the header errors are 100% covered
(minus mistakes during my manual aggregation of the results)

> > getloadavg
> > 	pbzip2, tokyotyrant, distccmon-gnome
> 
> This would probably be trivial to add.

return -1?

we can add it i guess but these packages could
use configure checks (i think they are autoconfed)

> > NO_ADDRESS
> > 	apache22, bglibs, cvsps, vanessa_logger, net6
> 
> This I would rather not add, since we don't support it, and providing
> the macro but never returning it could be misleading.

actually NO_ADDRESS is an alias for NO_DATA in glibc and the bsds
(for almost 20years now), but it's not critical

> > optreset
> > 	dar, freetds
> > 	(several configure checks found it incorrectly, but then it was not used)
> 
> Hm? I think we have optreset...

oops, my bad

some packages didnt find optreset in configure while others did

i guess the ones which failed tried unistd.h instead of getopt.h

> > semtimedop
> > 	sqlrelay
> 
> This is a Linux-specific sysvsem operation we're missing, right? If so
> I think the syscall wrapper should be added.

yes

IPCOP_semtimedop is 4 for SYS_ipc archs
and the other archs have SYS_semtimedop

> > herror
> > 	opencm
> 
> No idea what this even is.

"The (obsolete) herror() function prints the error message
associated with the current value of h_errno on stderr."

ie for printing errors of gethostbyname() and gethostbyaddr()

> > mallinfo
> > 	libfirm
> 
> Deprecated API but we could provide a dummy anyway.

it's so ugly with the signed int counters, i wouldnt
support if it's not widely used

i think libfirm can be fixed: it can either do the accounting
itself or has no business providing process-wide heap info
statistics (it is only used for a public diagnostic api)

> > TIMESPEC_TO_TIMEVAL
> > 	libusbx
> 
> Perhaps worth adding?

TIMEVAL_TO_TIMESPEC
TIMESPEC_TO_TIMEVAL

are bsd visible in freebsd, default visible in openbsd
and gnu visible in glibc in sys/time.h

can be added but only one pkg used it from 10k..

> > struct ip_mreq_source
> > 	mad-flute
> 
> There's an unresolved thread about adding these somewhere, possibly
> with a patch.
> 
> > F_EXLCK
> > 	qemu
> 
> Need more info on what it's about. Maybe something we should add.
> 
> > c_ispeed, c_ospeed (struct termios members)
> > 	icdprog
> 
> If c_* is reserved we could possibly add these.

c_* is reserved

> > libiconv_*
> > 	odt2txt, ted
> 
> Specific symbols ??

i've seen some iconv failures but these are probably not libc issues
(similar to the libintl_* case)

i guess this is just missing -liconv

gcc -o odt2txt -L/usr/lib -Wl,-R/usr/lib odt2txt.o regex.o mem.o strbuf.o kunzip/fileio.o kunzip/zipfile.o -lz
odt2txt.o: In function `main':
odt2txt.c:(.text.startup+0x25f): undefined reference to `libiconv_open'
odt2txt.c:(.text.startup+0x370): undefined reference to `libiconv'
odt2txt.c:(.text.startup+0x4eb): undefined reference to `libiconv_close'
odt2txt.c:(.text.startup+0x7e3): undefined reference to `libiconv_open'
odt2txt.c:(.text.startup+0x8ad): undefined reference to `libiconv'
odt2txt.c:(.text.startup+0x95a): undefined reference to `libiconvlist'
collect2: error: ld returned 1 exit status

and there is hex-a-hop:
...
configure: WARNING: unrecognized options: --with-libiconv-prefix, --with-libintl-prefix
...
text.cpp:447:77: error: invalid conversion from const char** to char** [-fpermissive]
  iconv(cd, (const char **)&in_buf, &text_length, &out_buf, &text_utf8_length);
                                                                             ^
In file included from /usr/include/SDL/SDL_stdinc.h:74:0,
                 from /usr/include/SDL/SDL_main.h:26,
                 from /usr/include/SDL/SDL.h:30,
                 from video.h:4,
                 from text.cpp:8:
/var/pkgsrc/games/hex-a-hop/work/.buildlink/include/iconv.h:81:15: error:   initializing argument 2 of size_t libiconv(libiconv_t, char**, size_t*, char**, size_t*) [-fpermissive]
 #define iconv libiconv
               ^
/var/pkgsrc/games/hex-a-hop/work/.buildlink/include/iconv.h:83:15: note: in expansion of macro iconv
 extern size_t iconv (iconv_t cd,  char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);

gnuplot misses -liconv as well:
...
/usr/lib/gcc/x86_64-linux-musl/4.8.1/../../../../x86_64-linux-musl/bin/ld: set.o: undefined reference to symbol 'libiconv_open'
/usr/lib/gcc/x86_64-linux-musl/4.8.1/../../../../x86_64-linux-musl/bin/ld: note: 'libiconv_open' is defined in DSO /usr/lib/libiconv.so.2 so try adding it to the linker command line
/usr/lib/libiconv.so.2: could not read symbols: Invalid operation

> > KIOCSOUND, TIOCCDTR, TIOCSDTR, TIOCGSIZE (ioctl)
> > 	minicom, modemd, beav
> 
> These should almost surely be added somewhere...

there are some other ioctl failures
but there might be some bsd only things in pkgsrc

> > execinfo.h
> > 	redis, virtuoso, powerdns, packagekit, qt4-creator
> 
> Backtrace stuff, right?

yes

now i see that redis also uses jemalloc which uses ffsl
"warning: implicit declaration of function ffsl"
that's another missing symbol

> > sys/bitypes.h
> > 	libbind, libdnsres
> 
> We could add this as an alias for sys/types.h with a #warning, if
> desired. I'm fairly indifferent.

it is only used by bind (i guess dnsres does the same)
i wouldnt be surprised if that had other incurable brokenness
but alias with warning is fine

> > sys/unistd.h
> > 	mlview, foobillard, galaxa, slurm
> 
> Ditto.

it seems this is a subset of unistd.h on the bsds
with just macro definitions on glibc it is an alias
to unistd.h

> > sys/endian.h
> > 	swarm
> 
> This could probably be added even without a #warning since it's
> nonstandard and sys/endian.h is just as "valid" as endian.h, but I'm
> not clear whether it's worth it for ONE obscure program that could
> just be fixed.

yes

> > net/ppp_defs.h
> > 	poptop, slurm, xfce4-netload-plugin
> 
> Don't know enough to comment.

glibc includes linux/ppp_defs.h (plus defines some libc types)

> > asm/page.h
> > 	clisp, s10sh, same
> 
> Isn't this a kernel header?

ah yes

> > sys/dirent.h
> > 	heirloom-libcommon
> 
> Possibly another #warning redirect?

can be, bsds have it (a subset of dirent.h)
but glibc does not have it as far as i can tell
so heirloom should be more clever about it
(i guess it has some broken ifdef around it)

> > xlocale.h
> > 	liblive
> 
> Since these interfaces were declared in xlocale.h before being
> standardized in POSIX 2008, it might make sense to provide the header;
> however, the fact that only one program was found to be needing it
> makes me doubt the usefulness.

note that vlc and some other media packages
depend on liblive, so ppl might want it

glibc only defines __local_t (and local_t)
types there

> > net/if_ether.h
> > 	cia
> 
> Is this a duplicate of the one in netinet or something different?

as far as i can see it's like netinet/if_ether.h on glibc
but glibc, freebsd, openbsd dont have it (i can only see
it in netbsd)

however netinet/if_ether.h includes net/ethernet.h on
glibc, but it's the other way around in musl
(and on glibc both headers include linux/if_ether.h)

that's probably a bug

> > net/if_packet.h
> > 	isc-dhcp4
> 
> And netpacket/packet.h?
> 
> > netinet/igmp.h
> > 	ngrep
> 
> Perhaps should be added.

yes i think so
(one of those old bsd headers that glibc provides in netinet)

> > fstab.h
> > 	samba35
> 
> Yet another hideous non-threadsafe, non-library-safe *ent API. As long
> as there's only one program using it my feeling is to omit it.

samba is probably an important one so it should be
fixed upstream if not yet done

> > error.h
> > 	vpnc
> 
> Wow, only one? There's been a fair amount of demand for error.h so I
> might add this one sometime...
> 
> > sys/perm.h
> > 	xosview
> 
> Seems redundant with sys/io.h?

yes, we could add an alias
(although on glibc sys/io.h has a bit more stuff)

> > gcc-4.8.1 bugs:
> > 	epic4: exec.c:118:18: internal compiler error: in set_lattice_value, at tree-ssa-ccp.c:451
> > 	bullet: btInternalEdgeUtility.cpp:310:2: internal compiler error: Segmentation fault
> > 	aegis fails because in libstdc++ cinttypes header is broken without -std=c++11 or -std=gnu++11
> > 	boost-libs fail because mm_malloc.h has incompatible posix_memalign decl with throw()
> 
> Was gcc built aginst musl? Assuming so, it's _possible_ that some of
> these are musl bugs, though gcc sounds more likely.

the mm_malloc.h thing is ugly, i'm not sure who else
uses that header, but the incompatible prototype
might bite others (i still dont quite understand
why extern "C" api needs throw() in glibc)

> > 	at least mysql5-client config uses getconf
> 
> Hm? We should probably provide a getconf that works with musl
> somewhere...

maybe landley could do one for toybox.. :)

> > -Werror suicide:
> > 	upx, mame, mess, tme, sfslite
> 
> If the warnings were musl-specific, they might be issues we should
> "fix" though.

no, these were things that would fail with glibc as well
(stricter pointer aliasing and unused warnings by gcc 4.8.1)

> > other
> > 	qt3-libs, ptlib: using signed int for socklen_t
> 
> glibc also has unsigned socklen_t, so I'm confused how they work with
> glibc but not musl...

yes, this is a mystery, actually the warning is shown for
many packages but most of them dont use Werror for it
maybe it's a recent gcc warning (passing int* instead of
socklen_t* aka unsigned* to interfaces like accept)

(and qt3-libs has quite a lot of dependencies, i think
it is the most wanted failing package on pkgsrc now)

> > 	pulseaudio, esound: broken /dev/dsp emulation with LD_PRELOAD hack
> > 	clang: DynamicLibrary.cpp has broken ifdef logic and stdin etc access
> > 	easytag, libpeas: NULL sentinel
> 
> BTW, I think we may need to re-think the NULL issue. POSIX seems to
> require it to have pointer type...

yes

> > 	binutils, mingw-binutils: empty character constant ''
> 
> Cause? musl-specific?

from the pkgsrc logs my guess is a $ got eaten by some tool
(maybe busybox?)

binutils builds here just fine (but i build it without bfd)

earm_epoc_pe.c: In function 'gld_arm_epoc_pe_place_orphan':
earm_epoc_pe.c:1512:37: error: empty character constant
       && (dollar = strchr (secname, '')) != NULL)
                                     ^
earm_epoc_pe.c:1646:25: error: empty character constant
      if (strchr (lname, '') == NULL)
                         ^

> > 	dosbox: uses undefined typename in offsetof
> 
> A type musl is missing?

rechecked and it is missing offsetof
(so it probably fails to include stddef.h)

> > 	boost/integer_traits.hpp: misses WCHAR_MIN and WCHAR_MAX because of ifdef hell
> 
> Oh? Is this their fault or something weird we're doing?

their fault, ugly ifdef hell instead of just
including wchar.h to work around broken platforms

http://boost.cvs.sourceforge.net/viewvc/boost/boost/boost/integer_traits.hpp?view=markup

> > 	libjit: #error "Don't know how to determine if floating point numbers are finite"
> 
> Is it doing stupid #ifdefs based on glibc version, or failing for some
> semi-readonable reason?

dont know, the log only has this message

> > 	tk: tkPanedWindow.o: file not recognized: File truncated
> 
> Weird...

yes the log has no context for it
and tk is a wanted package on pkgsrc

> > 	cc65, gnats, sandy: undefined siginfo_t because sys/wait.h is used with -std=c89
> 
> This is something we need to fix. I'm thinking sys/wait.h should just
> omit the stuff that needs siginfo_t if the right features are not
> enabled. (Really, omitting the whole file would be valid, but I
> suspect this would break programs worse.)
> 

makes sense

> > 	sdbm: cannot find ndbm.h
> 
> Presence or absence of ndbm in libc varies (it's supposedly required
> as part of XSI, IIRC) but I think we should leave it as a third-party
> thing. The API is so broken as to be utterly useless.
> 
> > include fails:
> > 	libbinio: EOF was not declared in this scope
> 
> Assumption that some random header includes stdio.h, maybe?
> 
> > 	libmpdclient: unknown type name fd_set
> 
> Probably the same, but for sys/select.h and sys/time.h.

failing to include sys/select.h is fairly common bug

> > 	glib: poll undeclared here
> 
> I never hit this one before; wonder why it's happening?

this is glib-1.2

...
> Pretty much all of these look like the same basic issue: invalid
> assumptions that one header includes another. This means they could
> probably easily be fixed upstream if somebody's willing to do the
> analysis to determine where the invalid assumptions are. Since these
> should all be non-controversial fixes, I think this would be a great
> "patch flood" project to precede or go along with the upcoming 1.0
> release, as discussed in the publicity plan thread.

yes

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.