summaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2020-07-06random: initial work at a new modulerandomA. Wilcox1-0/+1
This is a _dangerously_ naive implementation. Do not ship.
2020-07-06time: New module adding __strftime_lA. Wilcox1-0/+1
2020-07-06locale: New module for glibc locale_t ABI compatA. Wilcox1-0/+1
2019-01-05Fix compatibility with Linux 4.17+Samuel Holland1-1/+1
The gcompat loader compiled as a static binary doesn't work on Linux since commit a4ff8e8620d3f4, failing with the error: ``` Uhuuh, elf segment at 0000000000400000 requested but the memory is mapped already ``` This is because the binary we are the ELF interpreter for is also loaded at 0x400000. While it's actually okay to overlap the binary, since we're going to call `execve` again, the kernel doesn't allow the overlap anymore. Fix that by compiling the loader as static PIE, so it can be loaded at a different address. Signed-off-by: Samuel Holland <samuel@sholland.org>
2019-01-05Makefile: Detect and link an obstack librarySamuel Holland1-3/+15
Signed-off-by: Samuel Holland <samuel@sholland.org>
2019-01-05Makefile: Clean up compiler invocationsSamuel Holland1-9/+11
- Respect user CFLAGS and LDFLAGS consistently. - Consistent use of curly braces for variables over parentheses. - Sort flags, putting '-o' at the end for readability of `make` output. - -fPIE doesn't mean anything to the linker Signed-off-by: Samuel Holland <samuel@sholland.org>
2019-01-05Makefile: depend on internal.h; format headersSamuel Holland1-2/+3
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-09-11realpath: Intercept realpath(/proc/self/exe)Samuel Holland1-0/+1
Reuse the machinery from readlink Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-09-11ctype: Add __ctype_bSamuel Holland1-0/+1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-09-11cxx_thread: Add __cxa_thread_atexit_implSamuel Holland1-0/+1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-03-16build: allow building with libucontext supportWilliam Pitcock1-2/+9
2018-02-23libgcompat: add internal api for GCOMPAT__panic().William Pitcock1-0/+2
2018-01-15readlink: Intercept readlink("/proc/self/exe")Samuel Holland1-0/+1
This allows programs run through gcompat to fork and re-exec themselves. It fixes readlink("/proc/self/exe") to return the executable's absolute path, instead of musl's path. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15utmp: Implement the reentrant utmp function from LSBSamuel Holland1-0/+1
This takes advantage of the (lack of a) musl implementation for simplicity. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15unistd: Implement LSB functions plus moreSamuel Holland1-0/+1
On musl pread and pread64 are the same thing. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15syslog: Implement checked syslog functions from LSBSamuel Holland1-0/+1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15socket: Implement checked socket functions from LSBSamuel Holland1-0/+1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15signal: Add a signal function from LSBSamuel Holland1-0/+1
The other unimplemented signal function in LSB is sigreturn, with is not really implementable. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15netdb: Add protocol and service functions from LSBSamuel Holland1-0/+1
These take advantage of the musl implementation for simplicity. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15misc: Implement some miscellaneous functionsSamuel Holland1-0/+1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15error: Implement the error functionSamuel Holland1-0/+1
This follows the exceptionally-detailed functional description in the manual page. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15stdio: Clean up, add all of LSB stdio plus moreSamuel Holland1-1/+2
* Add all (non-wchar) stdio functions from LSB, plus those found in use in other applications. Document those functions from LSB as such. * Use a consistent structure and paramater names for all functions. * flag == 0 means FORTIFY_SOURCE=1, so the implemented checks should be unconditional. * Add all possible checks without parsing the format string. * Move functions from wchar.h to their own appropriately-named file. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15grp: Implement fgetgrent_r/getgrent_rSamuel Holland1-0/+1
Like fgetpwent_r/getpwent_r, these require a deep copy of the structure into the caller-provided buffer. This is nontrivial for the array of strings member. getgrent_r is required by LSB. [NOTE: I'm not too happy with the macro, but it works. Any suggestions?] Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14dlfcn: Combine functions for the same header into one fileSamuel Holland1-2/+1
Changes to existing code: * Make explicit comparison against NULL. * Adjust debug message for readability. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14execinfo: Clean up, implement backtrace_symbols_fdSamuel Holland1-1/+1
Rename the file to match the header it implements functions from. Changes to existing code: * Fix the return value from backtrace (off by one). * Use __builtin_extract_return_addr as recommended in gcc documentation. * Document header usage. * Document where the functions are referenced in the LSB standard. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14Makefile: Update compilation optionsSamuel Holland1-3/+4
* Remove -DPIC as it is unused (and PIC is always enabled). * Export the loader name as a macro (this will be used in the future). * Enable compiler warnings, except the expected ones. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14libgcompat: Add and use a macro for defining symbol aliasesSamuel Holland1-0/+4
* Prefer providing the underscore-prefixed symbol as the strong definition. * Do not use a weak alias if the alias is also underscore-prefixed. * Make libgcompat objects depend on the new header. [NOTE: I originally took the weak_alias macro from musl's libc.h, but it's trivial and the same pattern already in use. If desired, I can add the musl copyright notice.] Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14Add clang-format configuration and Makefile ruleSamuel Holland1-0/+5
The settings here are based on the current code style documentation. Signed-off-by: Samuel Holland <samuel@sholland.org>
2017-10-26Makefile: Ensure correct compilation on GCC 4.xA. Wilcox1-2/+5
On GCC 4.9.4, at least backtrace.c fails to compile because of variable declaration in a for statement, which requires -std=c99 or -std=c11. Since we are using ISO C mode instead of a GNU standard, we additionally must define _BSD_SOURCE to expose Dl_info for the dl code.
2017-10-15ucontext: new moduleA. Wilcox1-0/+1
2017-10-15resolv: new moduleA. Wilcox1-0/+1
2017-09-16Makefile: allow compilation with specified compiler rather than hard-coded gccDaniel James1-3/+3
2017-07-28libgcompat: add getpwent_r() and fgetpwent_r() stubsWilliam Pitcock1-0/+1
2017-06-14add sysctl()William Pitcock1-0/+1
2017-06-14pthread: add __register_atfork() stubWilliam Pitcock1-0/+1
2017-06-14recent musl has pthread_setname_np().William Pitcock1-1/+0
2017-06-14build system: add install target, fix loader build rulesWilliam Pitcock1-2/+6
2017-06-14add MakefileWilliam Pitcock1-0/+38