Commit Graph

827 Commits

Author SHA1 Message Date
Rich Felker
834255a3ff use __attribute__((const)) on arm __pthread_self function 2012-02-25 02:52:18 -05:00
Rich Felker
06aec8d715 replace prototype for basename in string.h with non-prototype declaration
GNU programs may expect the GNU version of basename, which has a
different prototype (argument is const-qualified) and prototype it
themselves too. of course if they're expecting the GNU behavior for
the function, they'll still run into problems, but at least this
eliminates some compile-time failures.
2012-02-24 23:23:47 -05:00
Rich Felker
78e79d9d50 new attempt at working around the gcc 3 visibility bug
since gcc is failing to generate the necessary ".hidden" directive in
the output asm, generate it explicitly with an __asm__ statement...
2012-02-24 20:07:21 -05:00
Rich Felker
7fa29920ed remove useless attribute visibility from definitions
this was a failed attempt at working around the gcc 3 visibility bug
affecting x86_64. subsequent patch will address it with an ugly but
working hack.
2012-02-24 20:02:42 -05:00
Rich Felker
bae2e52bfd cleanup and work around visibility bug in gcc 3 that affects x86_64
in gcc 3, the visibility attribute must be placed on both the
declaration and on the definition. if it's omitted from the
definition, the compiler fails to emit the ".hidden" directive in the
assembly, and the linker will either generate textrels (if supported,
such as on i386) or refuse to link (on targets where certain types of
textrels are forbidden or impossible without further assumptions about
memory layout, such as on x86_64).

this patch also unifies the decision about when to use visibility into
libc.h and makes the visibility in the utf-8 state machine tables
based on libc.h rather than a duplicate test.
2012-02-23 21:24:56 -05:00
Rich Felker
00b883a955 fix (hopefully) PTRACE_TRACEME (command 0) argument handling 2012-02-23 13:08:47 -05:00
Rich Felker
56ddcc7208 fix for previous incorrect fix of cancellation in dns lookups
uninitialized file descriptor was being closed on return, causing
stdin to be closed in many cases.
2012-02-23 13:07:20 -05:00
Rich Felker
f96eb335e1 fix get_current_dir_name behavior 2012-02-17 23:56:28 -05:00
Rich Felker
61c2cf877b remove -std=gnu99 from musl-gcc wrapper
while probably desirable, changing the default language variant is
outside the scope of the wrapper's responsibility.
2012-02-17 23:51:23 -05:00
Rich Felker
3c870263c5 two fixes for "make install" handling of shared libs
1. don't try to install (and thus build) shared libs when they were
disabled in config.mak

2. ensure that the path for the dynamic linker exists before
attempting to install it.
2012-02-17 23:17:48 -05:00
Rich Felker
1611ab0d9b add get_current_dir_name function 2012-02-17 23:10:00 -05:00
Rich Felker
414a4cdebc add float_t and double_t to math.h 2012-02-15 21:47:55 -05:00
Rich Felker
88d84b7cc8 fix default nameserver when resolv.conf doesn't exist 2012-02-11 00:06:32 -05:00
Rich Felker
f42bad9ccb fix illegal goto out of cleanup context in dns lookups 2012-02-11 00:05:58 -05:00
Rich Felker
2230218c28 small fix for new pthread cleanup stuff
even if pthread_create/exit code is not linked, run flag needs to be
checked and cleanup function potentially run on pop. thus, move the
code to the module that's always linked when pthread_cleanup_push/pop
is used.
2012-02-09 21:24:56 -05:00
Rich Felker
afc35d5efd replace bad cancellation cleanup abi with a sane one
the old abi was intended to duplicate glibc's abi at the expense of
being ugly and slow, but it turns out glib was not even using that abi
except on non-gcc-compatible compilers (which it doesn't even support)
and was instead using an exceptions-in-c/unwind-based approach whose
abi we could not duplicate anyway without nasty dwarf2/unwind
integration.

the new abi is copied from a very old glibc abi, which seems to still
be supported/present in current glibc. it avoids all unwinding,
whether by sjlj or exceptions, and merely maintains a linked list of
cleanup functions to be called from the context of pthread_exit. i've
made some care to ensure that longjmp out of a cleanup function should
work, even though it is not required to.

this change breaks abi compatibility with programs which were using
pthread cancellation, which is unfortunate, but that's why i'm making
the change now rather than later. considering that most pthread
features have not been usable until recently anyway, i don't see it as
a major issue at this point.
2012-02-09 02:33:08 -05:00
Rich Felker
ed2911a113 document iswspace and remove wrongly-included zwsp character 2012-02-09 00:27:19 -05:00
Rich Felker
520f3ee2b6 fix typo in iswspace space list table 2012-02-09 00:20:24 -05:00
Rich Felker
570edb19d1 fix typo in inotify.h 2012-02-07 22:48:58 -05:00
Rich Felker
f2baf4d7b8 protect against cancellation in dlopen
i'm not sure that it's "correct" for dlopen to block cancellation
when calling constructors for libraries it loads, but it sure seems
like the right thing. in any case, dlopen itself needs cancellation
blocked.
2012-02-07 20:31:27 -05:00
Rich Felker
700a8156ad reduce some wasted space in dso structure 2012-02-07 20:29:29 -05:00
Rich Felker
1ba28b90d6 declare basename in string.h when _GNU_SOURCE is defined
note that it still will have the standards-conformant behavior, not
the GNU behavior. but at least this prevents broken code from ending
up with truncated pointers due to implicit declarations...
2012-02-07 13:10:30 -05:00
Rich Felker
a591e0383a revert hacks for types of stdint.h integer constant macros
per 7.18.4: Each invocation of one of these macros shall expand to an
integer constant expression suitable for use in #if preprocessing
directives. The type of the expression shall have the same type as
would an expression of the corresponding type converted according to
the integer promotions. The value of the expression shall be that of
the argument.

the key phrase is "converted according to the integer promotions".
thus there is no intent or allowance that the expression have
smaller-than-int types.
2012-02-07 12:08:27 -05:00
Rich Felker
36bf56940a more locale_t interfaces (string stuff) and header updates
this should be everything except for some functions where the non-_l
version isn't even implemented yet (mainly some non-ISO-C wcs*
functions).
2012-02-06 21:51:02 -05:00
Rich Felker
c09b6f8ab6 fix some omissions and mistakes in locale_t interface definitions 2012-02-06 21:33:40 -05:00
Rich Felker
e5a7f14c81 add more of the locale_t interfaces, all dummied out to ignore the locale 2012-02-06 21:29:31 -05:00
Rich Felker
4cf667c9c9 x86_64 vfork implementation
untested; should work.
2012-02-06 18:23:11 -05:00
Rich Felker
ce4d97e3dc run ctors/dtors for shared objects loaded with dlopen 2012-02-06 17:57:29 -05:00
Rich Felker
4ce3cb5cdd add support for init/finit (constructors and destructors)
this is mainly in hopes of supporting c++ (not yet possible for other
reasons) but will also help applications/libraries which use (and more
often, abuse) the gcc __attribute__((__constructor__)) feature in "C"
code.

x86_64 and arm versions of the new startup asm are untested and may
have minor problems.
2012-02-06 14:39:09 -05:00
Rich Felker
f4ad36c4bf add deprecated (removed from posix) [efg]cvt() functions
these have not been heavily tested, but they should work as described
in the old standards. probably broken for non-finite values...
2012-02-06 01:14:23 -05:00
Rich Felker
5a09a53010 include dummied-out dlopen and dlsym functions for static binaries
these don't work (or do anything at all) but at least make it possible
to static link programs that insist on "having" dynamic loading
support...as long as they don't actually need to use it.

adding real support for dlopen/dlsym with static linking is going to
be significantly more difficult...
2012-02-03 03:16:07 -05:00
Rich Felker
4f4d6ae985 improve gcc wrapper to support -nostdlib, -nostartfiles 2012-02-02 23:54:46 -05:00
Rich Felker
5816592389 make stdio open, read, and write operations cancellation points
it should be noted that only the actual underlying buffer flush and
fill operations are cancellable, not reads from or writes to the
buffer. this behavior is compatible with POSIX, which makes all
cancellation points in stdio optional, and it achieves the goal of
allowing cancellation of a thread that's "stuck" on IO (due to a
non-responsive socket/pipe peer, slow/stuck hardware, etc.) without
imposing any measurable performance cost.
2012-02-02 00:11:29 -05:00
Rich Felker
4948a24df2 make passwd/group functions safe against cancellation in stdio
these changes are a prerequisite to making stdio cancellable.
2012-02-01 23:51:19 -05:00
Rich Felker
147f355cb6 apparently gnu caddr_t is supposed to be char *, not unsigned long
this type should never be used anyway, but some old junk uses it..
2012-02-01 14:12:19 -05:00
Rich Felker
96e0aca4d5 fix utmp.h mess, try 2 2012-02-01 14:10:38 -05:00
Rich Felker
108fdd3318 fix previous utmp.h junk commit 2012-01-31 17:10:02 -05:00
Rich Felker
fa3bbbd453 add some missing junk in utmp.h 2012-01-31 14:39:17 -05:00
Rich Felker
5e9314ff03 add fgetpwent (nonstandard function)
based on patch by Jeremy Huntwork
2012-01-29 11:54:18 -05:00
Rich Felker
4619901ec4 add linux setfs[ug]id syscall wrappers
patch by Jeremy Huntwork
2012-01-28 21:09:50 -05:00
Rich Felker
c3db56c4cb remove useless "extern" keywords in headers 2012-01-26 10:53:37 -05:00
Rich Felker
8eb9a3afba fix typo in FPE_FLTUND definition, signal.h 2012-01-25 15:30:42 -05:00
Rich Felker
6a193804a8 add MIN/MAX macros to sys/param.h
this is a nonstandard junk header anyway, so just do what apps expect..
2012-01-24 22:51:27 -05:00
Rich Felker
477e72ac4a add legacy futimes and lutimes functions
based on patch by sh4rm4. these functions are deprecated; futimens and
utimensat should be used instead in new programs.
2012-01-24 19:50:44 -05:00
Rich Felker
b768c7bc63 make gcc wrapper support -shared correctly
it was previously attempting to link start files as part of shared
objects. this is definitely wrong and depending on the platform and
linker could range from just adding extraneous junk to introducing
textrels to making linking fail entirely.
2012-01-24 00:22:27 -05:00
Rich Felker
d0678b58ab make glob mark symlinks-to-directories with the GLOB_MARK flag
POSIX is unclear on whether it should, but all historical
implementations seem to behave this way, and it seems more useful to
applications.
2012-01-23 19:51:34 -05:00
Rich Felker
fd7015d0c2 fix broken copy relocations from dynamic linker cleanup
this issue affected programs which use global variables exported by
non-libc libraries.
2012-01-23 18:32:40 -05:00
Rich Felker
e12fe65c92 dynamic linker support for PIE binaries (position-independent main program)
even with this change, PIE will not work yet due to deficiencies in
the crt1.o startup code.
2012-01-23 02:02:59 -05:00
Rich Felker
c82f4a32ec cleanup dynamic linker, removing some code duplication 2012-01-23 00:57:38 -05:00
Rich Felker
35620515a8 update release notes for 0.8.4 2012-01-23 00:37:45 -05:00