Wherever possible, rely on facilities native to GNU make rather than
invoke external utilities superfluously. Change the shell to /bin/sh
instead of bash since the latter's heftier feature set is unnecessary.
The -r option to cp(1) is marked obsolescent by POSIX; use -R instead.
Select between curl(1), wget(1), and ftp(1) through autoconf.
Wherever possible, automatically follow HTTP location redirects and
enable passive FTP mode.
Explicitly instruct tar(1) to read from stdin since this is far from
universal behavior if unspecified: The default file is /dev/sa0 in
FreeBSD, /dev/rst0 in NetBSD and OpenBSD, etc.
Tests for program presence, such as those formerly embedded in the
top-level Makefile for gawk and gsed, are better suited for autoconf.
Note that it is not sufficient to merely export AWK and SED environment
variables, as packages may still directly invoke awk(1) and sed(1) with
non-standard features independent of the autotools framework.
Wrapper scripts therefore remain necessary, although these are now
generated by the configure script to avoid hard-coded paths.
Do not assume the existence of /bin/bash on all systems.
This permits avoiding a misleading architecture prefix when building a
toolchain that support both RV32 and RV64. This makes glibc
consistent with binutils and gcc with respect to the riscv- target.
The target riscv- is identical to riscv64-, i.e., RV64 is the default.
This allows for sharing headers between RV32 and RV64 compilers, which
in turn supports a combined toolchain for both targets, with
appropriate duplicate builds of glibc.
x86 puts "struct user_regs_struct" in <sys/user.h>, but that requires
duplicating code between Linux and glibc. Even though it's just an
ABI-breaking structure, I don't want to do that.
This causes <sys/user.h> to end up defining "struct user_regs_struct"
which helps with compatibility. It's not a big deal because the
internals of "struct user_regs_struct" still need some #ifdef, but
it's one less line per package...
While not the greatest ports to copy, powerpc and sh do this. With
the patch Gentoo still builds.
So it turns out that the uapi stuff also broke libsanitizer in some
trivial ways -- essentially we need to replace the old version of the
*at syscalls with the new *at version and some flags. Upstream has
already fixed this, so all I really did is backport part of an
upstream patch that I don't care to track down the exact origin of:
commit 7d752f28b590bbad13c877c2aa7f5f8de2cdff10
Author: kcc <kcc@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu May 22 07:09:21 2014 +0000
libsanitizer merge from upstream r209283
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210743 138bc75d-0d04-0410-961f-82ee72b054a4
Note that this will:
* Break on anything that doesn't support uapi.
* Conflict with the patch that I assume will land in GCC-5.0.
Neither of which I think are important -- just don't build
riscv-gnu-toolchain for anything that's not RISC-V, and drop the patch
when you rebase to 5.0.
This is necessary to get Gentoo to build, as it builds libsanitizer.
Explicitly order the Implies subdirectory list such that "generic"
precedes "wordsize-64". Among other issues, the latter still partly
implements getdents(2) with the deprecated syscall of the same name,
despite getdents64 being available.
Symbols named with name FAKE_LABEL_NAME get emitted when generating DWARF,
so make sure FAKE_LABEL_NAME is printable. It still must be distinct from
any real label name, so I append a space, which other labels can't contain.
So "inline" isn't complient C, which means strict packages won't build
with it. This uses "__inline__" instead, which is ANSI C. This patch
is required to get freetype to build.
Although we don't know the branch offsets until linker relaxation, we can
still fill in a tentative value to make objdumps of object code more
readable.
Ensure that ld.so follows the preferred canonical behavior, whereby
dl_main() populates the DT_DEBUG entry in the .dynamic section with the
runtime address of the r_debug struct. GDB relies on r_debug to locate
the link map when reconstructing the shared library list.
This is documented in elf/rtld-debugger-interface.txt in the glibc
source tree.
I keep forgetting that the default option is to build newlib. This
flag changes the default target to Linux, so I don't keep forgetting
to type "make linux".