summaryrefslogtreecommitdiff
path: root/Makerules
AgeCommit message (Collapse)Author
2024-04-24Makerules: fix out-of-tree build error "Argument list too long"Max Filippov
Make rule that announces and makes static libc archive can generate command line that is too long when a full path O= option is used. That breaks the build with the following message: make: /bin/sh: Argument list too long Use make $(file) construct to generate file list file and use that file as $(AR) argument instead. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-02-18Add extra `-shared` to link.so command.Dmitry Chestnykh
While compiling OpenADK I discovered that there may be a case where UCLIBC_EXTRA_LDFLAGS contains `-fpie -pie`. Linker ignores `-shared` if `-pie` flag is passed after and produces an executable binary instead of shared object. This leads to linking failure because `ld-uClibc.so.1` becomes executable instead of shared object. `ld-uClibc.so.1` is used as one of the inputs when linking of libc.so.1 and linking proccess fails. To prevent this issue we need to pass extra `-shared` flag in `link.so` target command after all other flags to overwrite `-pie` effect. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2023-12-12elf: support ELF binaries in noMMUGreg Ungerer
The Linux kernels ELF-FDPIC binfmt program loader can support loading and running conventional ELF format binaries on noMMU kernels when compiled appropriately. That is when they are constant displacement binaries such as generated using the -pie compile option. Add a configure option to allow selecting ELF binary support in noMMU mode configurations on architectures that support this. The main requirement is to generate the ldso run-time loader to perform relocation at load time. These configurations do not support shared libraries, so there is no need to generate a full shared library, only the static version is required. The use of ELF format binaries does mean a slightly simpler toolchain generation (does not require a -uclinux- for some architectures) and does not require an extra tool like elf2flt. This initial support targets M68K, ARM and RISC-V architectures. No kernel changes are required, the required support for this is already in mainline kernels (certainly as of linux-6.6). Note that for the M68K and ARM architectures that the initialized registers and stack layout at process startup is slightly different for the flat format loader and the ELF/ELF-FDPIC loaders. So we need some changes to the startup code (crt1.S) for them. I have not done extensive testing outside of M68K, ARM and RISC-V. I had to make changes to a couple of the dl-startup.h architecture files to get them to build for this noMMU case. I did not dig down too deep on the reasons, but they still seem ok for the MMU case as well. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
2022-07-26Added support for creation of Static Position-Independent Executables (PIE) ↵linted
on i386, x86_64, and arm. This patch adds the generation of rcrt1.o which is used by gcc when compiling with the --static-pie flag. rcrt1.o differs from crt1.o and Scrt1.o in that it the executable has a dynamic section but no relocations have been performed prior to _start being called. crt1.o assumes there to be no dynamic relocations, and Scrt1.o has all relocations performed prior to execution by lsdo. The new reloc_static_pie function handles parsing the dynamic section, and performing the relocations in a architecture agnostic method. It also sets _dl_load_base which is used when initalizing TLS to ensure loading from the proper location. This allows for easier porting of static-pie support to additional architectures as only modifications to crt1.S to find the load address are required. Signed-off-by: linted <linted@users.noreply.github.com>
2016-12-20add stub implementation for libintl/gettextWaldemar Brodkorb
These adds the stubs from gettext-tiny 0.0.5 from here: https://github.com/sabotage-linux/gettext-tiny
2016-12-14add libiconv-tiny implementationWaldemar Brodkorb
To use it enable UCLIBC_HAS_LIBICONV, then iconv_open/iconv_close should be available.
2016-12-02remove libintl stub and libintl.h headerWaldemar Brodkorb
As __UCLIBC_HAS_GETTEXT_AWARENESS__ is never defined, this is mostly dead code. It is planned to integrate libiconv-tiny and gettext-tiny into uClibc-ng after the next release, so that more software packages can be used without modification. Remove any _/_N macro usage.
2016-11-29remove libresolv stubWaldemar Brodkorb
2016-11-27remove libnsl stubWaldemar Brodkorb
2016-10-28test: remove test suiteWaldemar Brodkorb
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
2016-08-27remove DOMULTI supportWaldemar Brodkorb
A single test with targeting ARM showed that this feature seems bit rotted. Remove DOMULTI and simplify Makefiles.
2016-01-01Add argp implementationSalvatore Cro
Argp is an advanced support for parsing unix-style argument vectors. In addition to the common getopt interface, it provides automatic response to `--help' and `--version' options and use of custom parser in conjunction with argp native option parser, among others. Argp support is required by elfutils package and prelink. In uClibc argp functionalities has been moved from C library to libuargp.so Further the libc.so linker script contains an AS_NEEDED entry so that it doesn't need to link libuargp.so explicitely. Disable argp test if feature disabled. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2015-12-05good by niosWaldemar Brodkorb
Get rid of NIOS support. We try to support NIOSII.
2015-06-10buildsys: swap V=1 with V=2 command printingBernhard Reutner-Fischer
Previously V=1 did print abbreviated commands and V=2 the full commands. Kbuild-based build-systems behave in the opposite way and this is apparently confusing or inconvenient for users so swap our V handling to be in line with kbuild (and automake as far as V=0 / V=1 is concerned). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-06-10buildsys: LT{,.old} CRT prereqBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14prelink: handle _begin in a gold-agnostic wayBernhard Reutner-Fischer
The nostartfiles is redundant but better be safe Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31buildsys: Do not build crt upon pregenBernhard Reutner-Fischer
No need to build crt when just generating headers Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-24buildsys: fix IS_IN_lib* for .sBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-18buildsys: fix IS_IN_lib* for .iBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-12buildsys: create linker script with proper flagsBernhard Reutner-Fischer
We were not passing the correct use-ld and -m{32,64,...} when creating the linker script. Revisit for gold later on anyway. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-27ldso: silence warningBernhard Reutner-Fischer
In file included from ldso/ldso/ldso.c:87:0: ldso/ldso/dl-startup.c: In function '_dl_start': ldso/ldso/dl-startup.c:184:32: warning: cast from pointer to integer of differennt size [-Wpointer-to-int-cast] auxvt[AT_BASE].a_un.a_val = (Elf32_Addr) &_begin; Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-01-28buildsys: fix IS_IN_lib* for out-of-tree buildsBernhard Reutner-Fischer
41537a770b46f2376e74af58ba4885749339e81e erroneously stripped the top_builddir off the per-directory flag setting which works fine for in-tree builds but is not correct for O= Just use the full path of the target files to apply the flags to fix that thinko. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16buildsys: fix IS_IN_lib*Bernhard Reutner-Fischer
define NOT_IN_libc / IS_IN_libxxx appropriately to fix pthread_once Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-29buildsys: refine compile.SBernhard Reutner-Fischer
filter out all -std= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-29buildsys: use SED for create-ldsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-12-20buildsys: Fix error on config clean in realcleanBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-11buildsys: on realclean, rm include/{config,generated}Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-06buildsys: rm PT startfiles on realcleanBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-07buildsys: Add missing $(SYMBOL_PREFIX) to symbol namesMarkos Chandras
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-05-21Makerules: Remove duplicated slashes in interp.cSedat Dilek
Peter Mazinger says in [1]: "I can revert it to the old behaviour in master (the change s://:/: should stay though)." [1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045049.html Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-21Revert "Makerules: respect HARDWIRED_ABSPATH in interp.c"Sedat Dilek
This reverts commit 5dffed7dd1a413f3965af702fa7ecd79809d1988. This breaks ldd when HARDWIRED_ABSPATH=n. [1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045048.html From: Timo Teräs <timo.teras@iki.fi> Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute path from the interpreter binary name embedded in ELF files. This makes ldd seg.fault as it seems to assume absolute paths. gdb sayeth: (gdb) where #0 0x00111ae3 in find_elf_interpreter (ehdr=0xb7a74000) at ../utils/ldd.c:556 #1 0x00111f2a in find_dependencies (filename=0x114910 "/home/fabled/aports/main/libc0.9.32/src/uClibc-0.9.32-rc3/lib/librt.so.0.9.32") at ../utils/ldd.c:676 #2 0x0011228e in main (argc=1, argv=0xbffff6e8) at ../utils/ldd.c:777 (gdb) p tmp tmp = NULL (gdb) p interp_dir $1 = 0x116660 "ld-uClibc.so.0.9.32" [2] http://lists.uclibc.org/pipermail/uclibc/2011-March/045054.html From: Mike Frysinger <vapier@gentoo.org> On Wed, Mar 23, 2011 at 7:18 AM, Peter Mazinger wrote: >> Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute >> path from the interpreter binary name embedded in ELF files. > > do you consider my patch wrong? yes. the absolute path to the ldso must be encoded in binaries. the point of HARDWIRED_ABSPATH is purely for sysroot/non-sysroot toolchain, and the interp path isnt involved with that. are you sure this even works at runtime ? i'm pretty sure the kernel doesnt do any path lookups on the interp string. Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-13buildsys: do not add empty obj to archivesBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-15buildsys: fix detection of silent makeMike Frysinger
The MAKEFLAGS variable contains all the flags without the leading dash. From the GNU make manual: This variable is set up automatically by make to contain the flag letters that make received. Thus, if you do ‘make -ks’ then MAKEFLAGS gets the value ‘ks’. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-14buildsys: cache build flags in varsMike Frysinger
Running `make clean` atm takes like 20 seconds because every subdir re-evaluates all the toolchain flags. Add some helpers to automate the process of setting up variables to cache the result of tests, as well as the checking of an already set flag. Now `make clean` takes like 2 seconds on my system. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-24Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (61 commits) fts: fix warning due to old-style function definition ldso_tls: fix compiler warning due to missing cast resolv: fix bug in res_init with ipv6 nameservers config: Fix passing defconfig args buildsys: pt-initfini.s depends on uClibc_config.h libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym() resolv: try next server on SERVFAIL getaddrinfo: allow numeric service without any hints bump version to 0.9.33-git nptl/pthread: Correct path for machine specific pt-initfini.c ctor/dtor nptl: Fix init and fini function compilation Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS ARM: remove EABI/OABI selection ARM: detect BX availibility at build time ARM: #include <bits/arm_asm.h> where __USE_BX__ is used ARM: transform the EABI/OABI choice into a boolean ARM: remove sub-arch/variants selection from menuconfig ARM: introduce blind options to select & force THUMB mode ARM: reorder "Use BX" option Fix __libc_epoll_pwait compile failure on x86 ... Conflicts: ldso/libdl/libdl.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-05-11buildsys: document UCLIBC_EXTRA_CPPFLAGSBernhard Reutner-Fischer
Rename EXTRA_CPPFLAGS to UCLIBC_EXTRA_CPPFLAGS and make them override previous flags (by appending - not prepending - them to the other flags).
2011-04-06Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (137 commits) utils/ldd: Check for returned pointer from strrchr not the value it holds cris: add provide arch-specific vfork implementation lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined bump version to 0.9.32-rc3-git release 0.9.32-rc3 memalign: include sys/param.h for MAX arm/bits/atomic.h: Include common/bit/atomic.h for thumb1 wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace add libc_hidden_proto for wcs[n]casecmp_l really fix missing __libc_drand48_data Revert "missing prototype of __libc_drand48_data fixed" missing prototype of __libc_drand48_data fixed time.c, time.h: remove unused hidden strftime/strptime nanosleep.c: remove duplicated libc_hidden_proto ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31 _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions time.c, wchar.h: remove unused hidden wcsftime str[n]casecmp.c: fix hidden usage remove unused hidden functions frv/memset.S: add missing libc_hidden_def ... Conflicts: ldso/ldso/ldso.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-03-08Makerules: respect HARDWIRED_ABSPATH in interp.cPeter S. Mazinger
Build LDSO path according to the HARDWIRED_ABSPATH setting While there, remove duplicated slashes in interp.c Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-05Add Makefile support for DSBT ELF.Bernd Schmidt bernds_cb1@t-online.de
This adds support for a new binary format, DSBT ELF, to the Makefiles. Every shared library is assigned a DSBT index, and the link.so macro is adjusted to ensure the correct linker argument is passed. Configuration and ldso support will follow in separate commits. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-11-28Merge commit 'origin/master' into prelinkCarmelo Amoroso
Conflicts: ldso/include/dl-hash.h Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-11-24buildsys: add make {,install_}startfilesBernhard Reutner-Fischer
This builds and installs the crt files. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-09-17ldso: Add runtime prelink supportFilippo Arcidiacono
Added runtime prelink support to be able to run a prelinked application; at process startup only the conflicts will be relocated. This speed up the startup time. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-09-15libubacktrace: Provide uClibc with backtrace functionsSalvatore Cro
A new shared object, libubacktrace.so.0 is added to uClibc to provide backtrace functions to support application self-debugging. This set of functions requires to dynamically load libgcc_s.so so they need to call dlopen/dlsym that are provided by libdl. For this reason they cannot be included into libc.so.0 but are provided by a new library. User application that wants to use backtrace needs to be compiled with -fexceptions option and -rdynamic to get full symbols printed and must be linked against libubacktrace.so Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-07-27buildsys: tweak quoting of V=Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-07-06nptl: fix buildsysBernhard Reutner-Fischer
Now automatically picks the correct (arch and subarch specific) impls in favour of generic impls. make O=/tmp/objs PREFIX=/my/sysroot -j works now as expected (both out-of-tree as well as parallel-safe). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-24buildsys: add brief mode; show defines and ld-flagsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-11buildsys: conceal install_headersBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-11buildsys: fix lib/ directory prerequisiteBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-08do not generate garbled interpBernhard Reutner-Fischer
for parallel make Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-04-22nptl: proper soname handlingNatanael Copa
Since sublevel releases are not ABI compatible we need to adjust the soname to include the sublevel version. This makes it possible to install ABI incompatible versions of the library side by side so clean upgrades are possible. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>