History log of /seL4-test-master/projects/musllibc/configure
Revision Date Author Comments
# 52f950d8 16-Dec-2019 Matthew <matt.phillips121@gmail.com>

trivial: revert the style mistake


# 28f4cac5 11-Dec-2019 Matthew <matt.phillips121@gmail.com>

Add flexible c compiler support

The C compiler will be specified in the toolchain file and set before
building musl


# 2435f79d 30-Jul-2016 Hesham Almatary <hesham.almatary@data61.csiro.au>

RISC-V port


# 088c9674 19-Dec-2016 Rich Felker <dalias@aerifal.cx>

when building for arm as thumb2 code, also request assembly as thumb

all assembly is now thumb2-compatible. on existing targets this is at
best a size optimization, but it will also facilitate porting to
thumb2-isa-only arm variants.


# 15094943 11-Nov-2016 Bobby Bingham <koorogi@koorogi.info>

add s390x port


# fff88018 23-Aug-2016 Szabolcs Nagy <nsz@port70.net>

configure: handle mipsisa64* triplet as a mips64 target

the gnu config.sub script recognizes several mipsisa64* cpu types
that musl supports as mips64 targets.


# c0ede9e4 30-Apr-2016 Bobby Bingham <koorogi@koorogi.info>

add powerpc64 port


# 6bc7d9c4 03-May-2016 LeMay, Michael <michael.lemay@intel.com>

fix redundant processing of --build flag in configure script

The --build flag is listed in two case statement entries in configure,
which causes the second entry to be ignored. This patch removes it
from the first entry.

Signed-off-by: Michael LeMay <michael.lemay@intel.com>


# 2d49c224 29-Apr-2016 Rich Felker <dalias@aerifal.cx>

follow standard configure behavior for cross compile prefix

the standard configure interface, which our configure script tries to
implement, identifies cross compiling (build != host) and searches for
the properly-prefixed cross tools. our script was not doing that,
forcing users to explicitly provide either CC or a CROSS_COMPILE tool
prefix, and the more common choice, just providing CC, was incomplete
because the Makefile would still invoke the native ar and ranlib
programs. this happened to work when building on ELF-based systems
with GNU binutils, but could easily fail when cross-compiling from
dissimilar systems.

like before, and like the standard configure behavior, an explicit CC
or CROSS_COMPILE variable on the command line or in the environment
overrides the automatic prefixing.


# 5972c4a4 17-Apr-2016 Rich Felker <dalias@aerifal.cx>

add mips n32 port (ILP32 ABI for mips64)

based on patch submitted by Jaydeep Patil, with minor changes.


# 6d99ad91 03-Apr-2016 Rich Felker <dalias@aerifal.cx>

add support for mips and mips64 r6 isa

mips32r6 and mips64r6 are actually new isas at both the asm source and
opcode levels (pre-r6 code cannot run on r6) and thus need to be
treated as a new subarch. the following changes are made, some of
which yield code generation improvements for non-r6 targets too:

- add subarch logic in configure script and reloc.h files for dynamic
linker name.

- suppress use of .set mips2 asm directives (used to allow mips2
atomic instructions on baseline mips1 builds; the kernel has to
emulate them on mips1) except when actually needed. they cause wrong
instruction encodings on r6, and pessimize inlining on at least some
compilers.

- only hard-code sync instruction encoding on mips1.

- use "ZC" constraint instead of "m" constraint for llsc memory
operands on r6, where the ll/sc instructions no longer accept full
16-bit offsets.

- only hard-code rdhwr instruction encoding with .word on targets
(pre-r2) where it may need trap-and-emulate by the kernel.
otherwise, just use the instruction mnemonic, and allow an arbitrary
destination register to be used.


# 636a4799 06-Mar-2016 Rich Felker <dalias@aerifal.cx>

make configure check for unsupported (SPE) powerpc hard-float models

the SPE ABI may be compatible with soft-float, but actually making it
work requires some additional work, so for now it's best to make sure
broken builds don't happen.


# 5a92dd95 25-Jan-2016 Felix Fietkau <nbd@openwrt.org>

add powerpc soft-float support

Some PowerPC CPUs (e.g. Freescale MPC85xx) have a completely different
instruction set for floating point operations (SPE).
Executing regular PowerPC floating point instructions results in
"Illegal instruction" errors.

Make it possible to run these devices in soft-float mode.


# 83933573 06-Mar-2016 Rich Felker <dalias@aerifal.cx>

add mips64 port

patch by Mahesh Bodapati and Jaydeep Patil of Imagination
Technologies.


# 4c101e15 18-Feb-2016 Rich Felker <dalias@aerifal.cx>

add arch tuple matching for nt32 and nt64 in configure

the nt32 and nt64 archs will be provided by the midipix project for
building musl on top of its posix-like syscall layer for windows. at
present the needed arch files are in a separate repository, but having
the tuple matching in the upstream configure script should make it
possible to overlay the arch files without needing any further
patching.


# 71c334f9 18-Feb-2016 Rich Felker <dalias@aerifal.cx>

work around regression building for armhf with clang (compiler bug)

commit e4355bd6bec89688e8c739cd7b4c76e675643dca moved the math asm
from external source files to inline asm, but unfortunately, all
current releases of clang use the wrong inline asm constraint codes
for float and double ("w" and "P" instead of "t" and "w",
respectively). this patch adds detection for the bug in configure,
and, for now, just disables the affected asm on broken clang versions.


# 5030e4a0 17-Feb-2016 Rich Felker <dalias@aerifal.cx>

partly revert detection of broken float in configure

commit 80fbaac4cd1930e9545a5d36bf46ae49011d2ce8 broke all soft-float
archs, where gcc defines __GCC_IEC_559==0 because rounding modes and
exception flags are not supported. for now, just check for
__FAST_MATH__ as an indication of broken float. this won't detect all
possible misconfigurations but it probably catches the most common
one.


# 80fbaac4 17-Feb-2016 Rich Felker <dalias@aerifal.cx>

make configure attempt to catch broken floating point CFLAGS/defaults


# 47314f1e 02-Feb-2016 Rich Felker <dalias@aerifal.cx>

make configure accept -h as an alias for --help


# 65498f28 30-Jan-2016 Rich Felker <dalias@aerifal.cx>

don't suppress shared libc when linker lacks -Bsymbolic-functions

previous work overhauling the dynamic linker made it so that linking
libc with -Bsymbolic-functions was no longer mandatory, but the
configure logic that forced --disable-shared when ld failed to accept
the option was left in place.

this commit removes the hard-coded -Bsymbolic-functions from the
Makefile and changes the configure test to one that simply adds it to
the auto-detected LDFLAGS on success.


# efdf04cf 27-Jan-2016 Rich Felker <dalias@aerifal.cx>

add arch/generic include fallback to build rules

this sets the stage for the first phase of the bits deduplication.
bits headers which are identical for "most" archs will be moved to
arch/generic/bits.


# e1d99894 27-Jan-2016 Rich Felker <dalias@aerifal.cx>

remove unneeded -I options from configure test for may_alias attribute

this test does not include anything, so the -I options are not useful
and are just a maintenance burden if paths change.


# 1619127c 25-Jan-2016 Rich Felker <dalias@aerifal.cx>

use same object files for libc.a and libc.so if compiler produces PIC

now that .lo and .o files differ only by whether -fPIC is passed (and
no longer at the source level based on the SHARED macro), it's
possible to use the same object files for both static and shared libc
when the compiler would produce PIC for the static files anyway. this
happens if the user has included -fPIC in their CFLAGS or if the
compiler has been configured to produce PIE by default.

we use the .lo files for both, and still append -fPIC to the CFLAGS,
rather than using the .o files so that libc.so does not break
catastrophically if the user later removes -fPIC from CFLAGS in
config.mak or on the make command line. this also ensures that we get
full -fPIC in case -fpic, -fPIE, or some other lesser-PIC option was
passed in CFLAGS.


# ce3e24ea 20-Jan-2016 Rich Felker <dalias@aerifal.cx>

fix global visibility (vis.h) support for out-of-tree builds

commit 2f853dd6b9a95d5b13ee8f9df762125e0588df5d failed to change the
test for -include vis.h support to use $srcdir, so vis.h was always
disabled by configure for out-of-tree builds.


# 2f853dd6 18-Nov-2015 Petr Hosek <phosek@chromium.org>

support out-of-tree build

this change adds support for building musl outside of the source
tree. the implementation is similar to autotools where running
configure in a different directory creates config.mak in the current
working directory and symlinks the makefile, which contains the
logic for creating all necessary directories and resolving paths
relative to the source directory.

to support both in-tree and out-of-tree builds with implicit make
rules, all object files are now placed into a separate directory.


# ea1e2c5e 07-Nov-2015 Rich Felker <dalias@aerifal.cx>

work around toolchains with broken visibility in libgcc/libpcc


# 6a851e3a 04-Nov-2015 Rich Felker <dalias@aerifal.cx>

have configure check/add --gc-sections linker option

this allowing the linker to drop certain weak definitions that are
only used as dummies for static linking. they could be eliminated for
shared library builds using the preprocessor instead, but we are
trying to transition to using the same object files for shared and
static libc, so a link-time solution is preferable.


# 2efd38e8 04-Nov-2015 Rich Felker <dalias@aerifal.cx>

have configure check/add linker options to reduce size lost to padding

based on patch by Denys Vlasenko. sorting sections and common data
symbols by alignment acts as an approximation for optimal packing,
which the linker does not actually support.


# 27c1eccf 04-Nov-2015 Rich Felker <dalias@aerifal.cx>

have configure check/add -ffunction-sections and -fdata-sections

based on patch by Denys Vlasenko. the original intent for using these
options was to enable linking optimizations. these are immediately
available for static linking applications to libc.a, and will also be
used for linking libc.so in a subsequent commit.

in addition to the original motives, this change works around a whole
class of toolchain bugs where the compiler generates relative address
expressions using a weak symbol and the assembler "optimizes out" the
relocation which should result by using the weak definition. (see gas
pr 18561 and gcc pr 66609, 68178, etc. for examples.) by having
different functions and data objects in their own sections, all
relative address expressions are cross-section and thus cannot be
resolved to constants until link time. this allows us to retain
support for affected compiler/assembler versions without invasive
and fragile source-level workarounds.


# 4cd8b472 02-Nov-2015 Rich Felker <dalias@aerifal.cx>

keep user-provided CFLAGS/LDFLAGS separate from those added by configure

this way, overriding these variables on the make command line (or just
re-passing the originally-passed values when invoking make) won't
suppress use of the flags added by configure.


# bc0c4841 22-Oct-2015 Rich Felker <dalias@aerifal.cx>

prevent user CFLAGS overrides from exposing executable stack

the option to suppress executable stack tagging was placed in CFLAGS,
which is treated as optional and overridable by the build system. if a
user replaces CFLAGS after configure has run, it could get lost,
resulting in a libc.so that's flagged as needing executable stack,
which would cause the kernel to map the initial stack as executable.

move -Wa,--noexecstack to CFLAGS_C99FSE, the make variable used for
mandatory compiler options.


# 79789980 15-Oct-2015 Rich Felker <dalias@aerifal.cx>

suppress sh assembler rejection of instructions based on isa level

we need access to all instructions in order for runtime selection of
atomic model to work correctly. without this patch, some versions of
gcc instruct gas to reject instructions outside the target isa level.


# f3a53f09 28-Sep-2015 Rich Felker <dalias@aerifal.cx>

eliminate protected-visibility data in libc.so with vis.h preinclude

some newer binutils versions print scary warnings about protected data
because most gcc versions fail to produce the right address
references/relocations for such data that might be subject to copy
relocations. originally vis.h explicitly assigned default visibility
to all public data symbols to avoid this issue, but commit
b8dda24fe1caa901a99580f7a52defb95aedb67c removed this treatment for
stdin/out/err to work around a gcc 3.x bug, and since they don't
actually need it (because taking their addresses is not valid C).

instead, a check for the gcc 3.x bug is added to the configure check
for vis.h preinclude support; this feature will simply be disabled
when using a buggy version of gcc.


# 2462370b 22-Sep-2015 Rich Felker <dalias@aerifal.cx>

try to suppress linking libc.so if there are undefined symbols

this is always an error and usually results from failure to find/link
the compiler runtime library, but it could also result from
implementation errors in libc, using functions that don't (yet) exist.
either way the resulting libc.so will crash mysteriously at runtime.
the crash happens too early to produce a meaningful error, so these
crashes are very confusing to users and waste a lot of debugging time.
this commit should ensure that they do not happen.


# c42650ab 21-Sep-2015 Rich Felker <dalias@aerifal.cx>

remove configure's suppression of enable sh/fdpic shared library build


# d4c82d05 11-Sep-2015 Rich Felker <dalias@aerifal.cx>

add sh fdpic subarch variants

with this commit it should be possible to produce a working
static-linked fdpic libc and application binaries for sh.

the changes in reloc.h are largely unused at this point since dynamic
linking is not supported, but the CRTJMP macro is used one place
outside of dynamic linking, in __unmapself.


# 35b3312b 10-Jul-2015 Alex Dowad <alexinbeijing@gmail.com>

Build process uses script to add CFI directives to x86 asm

Some functions implemented in asm need to use EBP for purposes other
than acting as a frame pointer. (Notably, it is used for the 6th
argument to syscalls with 6 arguments.) Without frame pointers, GDB
can only show backtraces if it gets CFI information from a
.debug_frame or .eh_frame ELF section.

Rather than littering our asm with ugly .cfi directives, use an awk
script to insert them in the right places during the build process, so
GDB can keep track of where the current stack frame is relative to the
stack pointer. This means GDB can produce beautiful stack traces at
any given point when single-stepping through asm functions.

Additionally, when registers are saved on the stack and later
overwritten, emit ..cfi directives so GDB will know where they were
saved relative to the stack pointer. This way, when you look back up
the stack from within an asm function, you can still reliably print
the values of local variables in the caller.

If this awk script were to understand every possible wild and crazy
contortion that an asm programmer can do with the stack and registers,
and always emit the exact ..cfi directives needed for GDB to know what
the register values were in the preceding stack frame, it would
necessarily be as complex as a full x86 emulator. That way lies
madness.

Hence, we assume that the stack pointer will _only_ ever be adjusted
using push/pop or else add/sub with a constant. We do not attempt to
detect every possible way that a register value could be saved for
later use, just the simple and common ways.

Thanks to Szabolcs Nagy for suggesting numerous improvements to this
code.


# fb58545f 28-Jun-2015 Shiz <hi@shiz.me>

add musl-clang, a wrapper for system clang installs

musl-clang allows the user to compile musl-powered programs using their
already existent clang install, without the need of a special cross compiler.
it achieves this by wrapping around both the system clang install and the
linker and passing them special flags to re-target musl at runtime.
it does only affect invocations done through the special musl-clang wrapper
script, so that the user setup remains fully intact otherwise.

the clang wrapper consists of the compiler frontend wrapper script,
musl-clang, and the linker wrapper script, ld.musl-clang.
musl-clang makes sure clang invokes ld.musl-clang to link objects; neither
script needs to be in PATH for the wrapper to work.


# f8db6f74 28-Jun-2015 Shiz <hi@shiz.me>

build: fix musl-targeting toolchain test

the old test was broken in that it would never fail on a toolchains built
without dynamic linking support, leading to the wrapper script possibly being
installed on compilers that do not support it. in addition, the new test is
portable across compilers: the old test only worked on GCC.

the new test works by testing whether the toolchain libc defines __GLIBC__:
most non-musl Linux libc's do define this for compatibility even when they
are not glibc, so this is a safe bet to check for musl. in addition, the
compiler runtime would need to have a somewhat glibc-compatible ABI in the
first place, so any non-glibc compatible libc's compiler runtime might not
work. it is safer to disable these cases by default and have the user enable
the wrappers manually there using --enable-wrapper if they certain it works.


# b3cd7d13 28-Jun-2015 Shiz <hi@shiz.me>

build: overhaul wrapper script system for multiple wrapper support

this overhauls part of the build system in order to support multiple
toolchain wrapper scripts, as opposed to solely the musl-gcc wrapper as
before. it thereby replaces --enable-gcc-wrapper with --enable-wrapper=...,
which has the options 'auto' (the default, detect whether to use wrappers),
'all' (build and install all wrappers), 'no' (don't build any) and finally
the options named after the individual compiler scripts (currently only
'gcc' is available) to build and install only that wrapper.
the old --enable-gcc-wrapper is removed from --help, but still available.

it also modifies the wrappers to use the C compiler specified to the build
system as 'inner' compiler, when applicable. as wrapper detection works by
probing this compiler, it may not work with any other.


# fc431d3f 27-May-2015 Shiz <hi@shiz.me>

configure: work around compilers that merely warn for unknown options

some compilers (such as clang) accept unknown options without error,
but then print warnings on each invocation, cluttering the build
output and burying meaningful warnings. this patch makes configure's
tryflag and tryldflag functions use additional options to turn the
unknown-option warnings into errors, if available, but only at check
time. these options are not output in config.mak to avoid the risk of
spurious build breakage; if they work, they will have already done
their job at configure time.


# 3aacb54e 22-Apr-2015 Rich Felker <dalias@aerifal.cx>

fix syntax errors in configure script


# 428462a4 21-Apr-2015 Rich Felker <dalias@aerifal.cx>

make configure check for visibility preinclude compatible with pcc

pcc does not search for -include relative to the working directory
unless -I. is used. rather than adding -I., which could be problematic
if there's extra junk in the top-level directory, switch back to the
old method (reverting commit 60ed988fd6c67b489d7cc186ecaa9db4e5c25b8c)
of using -include vis.h and relying on -I./src/internal being present
on the command line (which the Makefile guarantees). to fix the
breakage that was present in trycppif checks with the old method,
$CFLAGS_AUTO is removed from the command line passed to trycppif; this
is valid since $CFLAGS_AUTO should not contain options that alter
compiler semantics or ABI, only optimizations, warnings, etc.


# a6274a19 21-Apr-2015 Andre McCurdy <armccurdy@gmail.com>

configure: check for -march and -mtune passed via CC

Some build environments pass -march and -mtune as part of CC, therefore
update configure to check both CC and CFLAGS before making the decision
to fall back to generic -march and -mtune options for x86.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>


# 60ed988f 20-Apr-2015 Rich Felker <dalias@aerifal.cx>

fix regression in configure script with new visibility option

commit de2b67f8d41e08caa56bf6540277f6561edb647f introduced a
regression by adding a -include option to CFLAGS_AUTO which did not
work without additional -I options. this broke subsequent trycppif
tests and caused x86_64 to be misdetected as x32, among other issues.
simply using the full relative pathname to vis.h rather than -I is the
cleanest way to fix the problem.


# de2b67f8 19-Apr-2015 Rich Felker <dalias@aerifal.cx>

add optional global visibility override

this is implemented via the build system and does not affect source
files. the idea is to use protected or hidden visibility to prevent
the compiler from pessimizing function calls within a shared (or
position-independent static) libc in the form of overhead setting up
for a call through the PLT. the ld-time symbol binding via the
-Bsymbolic-functions option already optimized out the PLT itself, but
not the code in the caller needed to support a call through the PLT.
on some archs this overhead can be substantial; on others it's
trivial.


# 1ef849c6 13-Apr-2015 Rich Felker <dalias@aerifal.cx>

allow libc itself to be built with stack protector enabled

this was already essentially possible as a result of the previous
commits changing the dynamic linker/thread pointer bootstrap process.
this commit mainly adds build system infrastructure:

configure no longer attempts to disable stack protector. instead it
simply determines how so the makefile can disable stack protector for
a few translation units used during early startup.

stack protector is also disabled for memcpy and memset since compilers
(incorrectly) generate calls to them on some archs to implement
struct initialization and assignment, and such calls may creep into
early initialization.

no explicit attempt to enable stack protector is made by configure at
this time; any stack protector option supported by the compiler can be
passed to configure in CFLAGS, and if the compiler uses stack
protector by default, this default is respected.


# 01ef3dd9 10-Mar-2015 Szabolcs Nagy <nsz@port70.net>

add aarch64 port

This adds complete aarch64 target support including bigendian subarch.

Some of the long double math functions are known to be broken otherwise
interfaces should be fully functional, but at this point consider this
port experimental.

Initial work on this port was done by Sireesh Tripurari and Kevin Bortis.


# b553dc4f 30-Jan-2015 Rich Felker <dalias@aerifal.cx>

fix failure of configure to detect gcc due to message translations

based on patch by Vadim Ushakov. in general overriding LC_ALL rather
than specific categories (here, LC_MESSAGES) is undesirable, but
LC_ALL is easier and in this case there is nothing else that depends
on the locale in this invocation of the compiler.


# 200d1547 17-Jul-2014 Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

add or1k (OpenRISC 1000) architecture port

With the exception of a fenv implementation, the port is fully featured.
The port has been tested in or1ksim, the golden reference functional
simulator for OpenRISC 1000.
It passes all libc-test tests (except the math tests that
requires a fenv implementation).

The port assumes an or1k implementation that has support for
atomic instructions (l.lwa/l.swa).

Although it passes all the libc-test tests, the port is still
in an experimental state, and has yet experienced very little
'real-world' use.


# a6adb2bc 16-Jul-2014 Rich Felker <dalias@aerifal.cx>

work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1

previously we detected this bug in configure and issued advice for a
workaround, but this turned out not to work. since then gcc 4.9.0 has
appeared in several distributions, and now 4.9.1 has been released
without a fix despite this being a wrong code generation bug which is
supposed to be a release-blocker, per gcc policy.

since the scope of the bug seems to affect only data objects (rather
than functions) whose definitions are overridable, and there are only
a very small number of these in musl, I am just changing them from
const to volatile for the time being. simply removing the const would
be sufficient to make gcc 4.9.1 work (the non-const case was
inadvertently fixed as part of another change in gcc), and this would
also be sufficient with 4.9.0 if we forced -O0 on the affected files
or on the whole build. however it's cleaner to just remove all the
broken compiler detection and use volatile, which will ensure that
they are never constant-folded. the quality of a non-broken compiler's
output should not be affected except for the fact that these objects
are no longer const and thus possibly add a few bytes to data/bss.

this change can be reconsidered and possibly reverted at some point in
the future when the broken gcc versions are no longer relevant.


# 4ad3588c 20-Jun-2014 Rich Felker <dalias@aerifal.cx>

remove optimization-inhibiting behavior from configure's --enable-debug

this behavior turned out to be counter-intuitive to users and in any
case it's unnecessary. optimization can be disabled explicitly using
the --disable-optimize option, or both can be achieved without any
enable/disable options by passing CFLAGS="-O0 -g".


# d79b2778 09-Jun-2014 Rich Felker <dalias@aerifal.cx>

fail configure on --enable-shared if -Bsymbolic-functions doesn't work

previously, a warning was issued in this case no matter what, even if
--disable-shared was used. now, the default for --enable-shared is
changed from "yes" to "auto", and the warning is issued by default,
but becomes an error if --enable-shared is used, and the test is
suppressed completely if --disable-shared is used.


# 7c6db373 20-May-2014 Rich Felker <dalias@aerifal.cx>

trivial formatting fix for the config.mak generated by configure


# 9ca4dae5 19-May-2014 Rich Felker <dalias@aerifal.cx>

add configure check for broken gcc 4.9.0 and possibly other versions

this is gcc bug #61144. the broken compiler is detected, but the user
must manually work around it. this is partly to avoid complex logic
for adding workaround CFLAGS and attempting to recheck with them, and
partly for the sake of letting the user know the compiler is broken
(since the workaround will result in less-efficient code production).

some refactoring was also needed to move the check for gcc outside of
the check for whether to build the compiler wrapper.


# 8945667f 12-May-2014 Rich Felker <dalias@aerifal.cx>

add configure check for working compiler

without this, broken choices of CC/CPPFLAGS/CFLAGS don't show up until
late in the configure process where they are confusingly reported as a
different failure such as incorrect long double type.


# 23d64182 27-Apr-2014 Bobby Bingham <koorogi@koorogi.info>

fix superh nofpu check on old gcc versions

As far as gcc3 knows, sh4 is the only processor version that can have an
FPU, so it indicates the FPU's presence by defining __SH4__. This is not
defined if there is no FPU, even if the processor really is an SH4.

Starting with gcc4, there is support for the sh2a processor, which has an
FPU but is not an SH4. gcc4 therefore additionally defines __SH_FPU_ANY__
when there is an FPU, but still doesn't define __SH4__ for an FPU-less sh4.

Therefore, to support all gcc versions, we must look at both preprocessor
symbols.


# 8c820231 19-Mar-2014 rofl0r <retnyg@gmx.net>

configure: check for __ILP32__ if arch is x86_64

otherwise a multilib compiler used with -mx32 will not be detected
properly.


# f162c064 17-Mar-2014 Rich Felker <dalias@aerifal.cx>

make configure accept alternate gcc tuples for x32

the previous pattern required "x32" to be used as the second field of
the gcc tuple, which is usually reserved for vendor use and not
appropriate as an ABI specifier. with this change, putting "x32" at
the end of the tuple, the way ABI specifiers are normally done, is
also permitted.


# 0b8f0c57 28-Feb-2014 Rich Felker <dalias@aerifal.cx>

improve configure's target arch matching

most notably, it was failing to match sh4-*, etc., but in general the
explicit matching of hyphens for some archs was problematic because it
failed to accept simply the musl-style arch name (without a gcc-style
tuple) as an input. the original motivation of matching hyphens was to
prevent incorrectly identifying a 64-bit arch as the corresponding
32-bit arch (e.g. mips* matching mips64) but this is easily fixed by
simply checking (and for now, rejecting as unsupported) the relevant
64-bit archs.


# 3d7f5c36 27-Feb-2014 Rich Felker <dalias@aerifal.cx>

fix missing CFLAGS in configure test for float on sh


# 946b9fad 27-Feb-2014 Rich Felker <dalias@aerifal.cx>

fix copy-and-paste error in configure's IEEE double check for sh


# b1683a1d 27-Feb-2014 Rich Felker <dalias@aerifal.cx>

add nofpu subarchs to the sh arch, and properly detect compiler's fpu config


# 5c27c445 27-Feb-2014 Rich Felker <dalias@aerifal.cx>

fix endian subarchs for sh arch

default endianness for sh on linux is little, and while conventions
vary, "eb" seems to be the most widely used suffix for big endian.


# aacd3486 27-Feb-2014 Rich Felker <dalias@aerifal.cx>

rename superh port to "sh" for consistency

linux, gcc, etc. all use "sh" as the name for the superh arch. there
was already some inconsistency internally in musl: the dynamic linker
was searching for "ld-musl-sh.path" as its path file despite its own
name being "ld-musl-superh.so.1". there was some sentiment in both
directions as to how to resolve the inconsistency, but overall "sh"
was favored.


# e5bb165b 24-Feb-2014 Szabolcs Nagy <nsz@port70.net>

mips: add mips-sf subarch support (soft-float)

Userspace emulated floating-point (gcc -msoft-float) is not compatible
with the default mips abi (assumes an FPU or in kernel emulation of it).
Soft vs hard float abi should not be mixed, __mips_soft_float is checked
in musl's configure script and there is no runtime check. The -sf subarch
does not save/restore floating-point registers in setjmp/longjmp and only
provides dummy fenv implementation.


# 3a3c813e 05-Oct-2013 Bobby Bingham <koorogi@koorogi.info>

superh port


# adbeefbe 07-Jan-2014 rofl0r <retnyg@gmx.net>

configure: suppress bogus pointer-int cast warnings


# 3e4b2cdc 07-Jan-2014 rofl0r <retnyg@gmx.net>

configure: recognize x86_64-x32 and x32

x32 is the internal arch name, but glibc uses x86_64-x32.
there doesn't exist a specific triple for x32 in gcc and binutils.
you're supposed to build your compiler for x86_64 and configure
it with multilib support for "mx32".

however it turns out that using a triple of x86_64-x32 makes
gcc and binutils pick up the right arch (they detect it as x86_64)
and allows us to have a unique triple for cross-compiler toolchains.


# f7bc29ed 28-Aug-2013 Rich Felker <dalias@aerifal.cx>

remove -Wcast-align from --enable-warnings

I originally added this warning option based on a misunderstanding of
how it works. it does not warn whenever the destination of the cast
has stricter alignment; it only warns in cases where misaligned
dereference could lead to a fault. thus, it's essentially a no-op for
i386, which had me wrongly believing the code was clean for this
warning level. on other archs, numerous diagnostic messages are
produced, and all of them are false-positives, so it's better just not
to use it.


# 06ceee8c 27-Aug-2013 Rich Felker <dalias@aerifal.cx>

add attribute((may_alias)) checking in configure

this will be needed for upcoming commits to the string/mem functions
to correct their unannounced use of aliasing violations for
word-at-a-time search, fill, and copy operations.


# e449974d 20-Aug-2013 Rich Felker <dalias@aerifal.cx>

fix two bugs in sed code configure uses to save command line

one place where semicolon (non-portable) was still used in place of
separate -e options (copied over from an old version of this code),
and use of a literal slash in the bracket expression for the final
command, despite slash being used as the delimiter for the s command.


# 453f4622 16-Aug-2013 Rich Felker <dalias@aerifal.cx>

make configure store its command line in config.mak for easy re-run

proper shell quoting and pretty-printing (avoiding ugly gratuitous
quoting and bad quoting style) is included.


# 4918c2bb 16-Aug-2013 Rich Felker <dalias@aerifal.cx>

fix detection of arm hardfloat

it turns out that __SOFTFP__ does not indicate the ABI in use but
rather that fpu instructions are not to be used at all. this is
specified in ARM's documentation so I'm unclear on how I previously
got the wrong idea. unfortunately, this resulted in the 0.9.12 release
producing a dynamic linker with the wrong name. fortunately, there do
not yet seem to be any public toolchain builds using the wrong name.

the __ARM_PCS_VFP macro does not seem to be official from ARM, and in
fact it was missing from the very earliest gcc versions (around 4.5.x)
that added -mfloat-abi=hard. it would be possible on such versions to
perform some ugly linker-based tests instead in hopes that the linker
will reject ABI-mismatching object files, if there is demand for
supporting such versions. I would probably prefer to document which
versions are broken and warn users to manually add -D__ARM_PCS_VFP if
using such a version.

there's definitely an argument to be made that the fenv macros should
be exposed even in -mfloat-abi=softfp mode. for now, I have chosen not
to expose them in this case, since the math library will not
necessarily have the capability to raise exceptions (it depends on the
CFLAGS used to compile it), and since exceptions are officially
excluded from the ARM EABI, which the plain "arm" arch aims to
follow.


# 90d77722 11-Aug-2013 Rich Felker <dalias@aerifal.cx>

allow subarch-specific asm, including asm specific to the default

the default subarch is the one whose full name is just the base arch
name, with no suffixes. normally, either the asm in the default
subarch is suitable for all subarch variants, or separate asm is
mandatory for each variant. however, in the case of asm which is
purely for optimization purposes, it's possible to have asm that only
works (or only performs well) on the default subarch, and not any othe
the other variants. thus, I have added a mechanism to give a name to
the default variant, for example "armel" for the default,
little-endian arm. further such default-subarch names can be added in
the future as needed.


# 86cc54b5 02-Aug-2013 Rich Felker <dalias@aerifal.cx>

protect against long double type mismatches (mainly powerpc for now)

check in configure to be polite (failing early if we're going to fail)
and in vfprintf.c since that is the point at which a mismatching type
would be extremely dangerous.


# 4a1f55e9 01-Aug-2013 Rich Felker <dalias@aerifal.cx>

work around gcc 4.8's generation of self-referential mem* functions at -O3


# 43d25313 24-Jul-2013 Rich Felker <dalias@aerifal.cx>

do not include math modules in the default -O3 optimization set

it's not clear that -O3 helps them, and gcc seems to have floating
point optimization bugs that introduce additional failures when -O3 is
used on some of these files.


# a80847d8 22-Jul-2013 Rich Felker <dalias@aerifal.cx>

enhance build process to allow selective -O3 optimization

the motivation for this patch is that the vast majority of libc is
code that does not benefit at all from optimizations, but that certain
components like string/memory operations can be major performance
bottlenecks.

at the same time, the old -falign-*=1 options are removed, since they
were only beneficial for avoiding bloat when global -O3 was used, and
in that case, they may have prevented some of the performance gains.

to be the most useful, this patch will need further tuning. in
particular, research is needed to determine which components should be
built with -O3 by default, and it may be desirable to remove the
hard-coded -O3 and instead allow more customization of the
optimization level used for selected modules.


# df065781 18-Jul-2013 Rich Felker <dalias@aerifal.cx>

fix invalid C in new trycppif tests in configure script

an empty program is not valid and would be reasonable grounds for the
compiler to give an error, which would break these tests.


# 3e7f186e 18-Jul-2013 Rich Felker <dalias@aerifal.cx>

add build system support for arch endian & float abi variants


# 2384f27d 11-Dec-2012 Rich Felker <dalias@aerifal.cx>

treat invalid C as an error even if warnings aren't enabled.


# 6c0cba81 18-Nov-2012 Rich Felker <dalias@aerifal.cx>

fix error in configure script using >/dev/null in noclobber mode


# 1c8eb8ba 09-Nov-2012 rofl0r <retnyg@gmx.net>

PPC port cleaned up, static linking works well now.


# 3d9e3a30 08-Nov-2012 Rich Felker <dalias@aerifal.cx>

fix "configure --prefix=" and improve path/arg handling in configure

previously, empty string was treated as "use default". this is
apparently not compatible with standard configure semantics where an
empty prefix puts everything under /. the new logic should be a lot
cleaner and not suffer from such issues.


# cd31a1fc 26-Oct-2012 Rich Felker <dalias@aerifal.cx>

further pcc fixes in configure

-lpcc only works if -nostdlib is not passed, so it's useless. instead,
use -print-file-name to look up the full pathname for libpcc.a, and
check whether that succeeds before trying to link with the result.

also, silence pcc's junk printed on stdout during tests.


# 3d99266b 26-Oct-2012 Rich Felker <dalias@aerifal.cx>

add support for detecting pcc's compiler runtime

in old versions of pcc, the directory containing libpcc.a was not in
the library path, and other options like -print-file-name may have
been needed to locate it. however, -print-file-name itself seems to
have been added around the same time that the directory was added to
the search path, and moreover, I see no evidence that older versions
of pcc are capable of building a working musl shared library. thus, it
seems reasonable to just test whether -lpcc is accepted.


# 80a45458 25-Oct-2012 Rich Felker <dalias@aerifal.cx>

configure: test not just compiling but linking with -march/-mtune

pcc wrongly passes any option beginning with -m to the linker, and
will break at link time if these options were added to CFLAGS. testing
linking lets us catch this at configure time and skip them.


# 01e5a1b6 18-Oct-2012 Rich Felker <dalias@aerifal.cx>

use $CC rather than "$CC" in configure script

this is necessary to allow $CC with arguments in it


# adefe830 03-Oct-2012 Rich Felker <dalias@aerifal.cx>

tell the assembler to mark all files as not requiring executable stack

for some reason this option is undocumented. not sure when it was
added, so I'm using a configure test. gcc was already setting the mark
correctly for C files, but assembler source files would need ugly
.note boilerplate in every single file to achieve this without the
option to the assembler.

blame whoever thought it would be a good idea to make the stack
executable by default rather than doing it the other way around...


# 8c0a3d9e 28-Sep-2012 Rich Felker <dalias@aerifal.cx>

microblaze port

based on initial work by rdp, with heavy modifications. some features
including threads are untested because qemu app-level emulation seems
to be broken and I do not have a proper system image for testing.


# 2c1cd239 10-Sep-2012 Rich Felker <dalias@aerifal.cx>

add LIBCC (compiler runtime) logic and override to configure

this should both fix the issue with ARM needing -lgcc_eh (although
that's really a bug in the libgcc build process that's causing
considerable bloat, which should be fixed) and make it easier to build
musl using clang/llvm in place of gcc. unfortunately I don't know a
good way to detect and support pcc's -lpcc since it's not in pcc's
default library search path...


# b439c051 29-Aug-2012 Rich Felker <dalias@aerifal.cx>

get rid of eh_frame bloat

if needed for debugging, it will be output in the .debug_frame section
instead, where it is not part of the loaded program and where the
strip command is free to strip it.


# 2bd05a4f 25-Aug-2012 Rich Felker <dalias@aerifal.cx>

add gnu hash support in the dynamic linker

based on the patches contributed by boris brezillon.


# 94e920d0 14-Aug-2012 Rich Felker <dalias@aerifal.cx>

support configuring cross compiling with CROSS_COMPILE prefix variable


# 721564a2 05-Aug-2012 Rich Felker <dalias@aerifal.cx>

make configure accept mipsel


# 470569ca 04-Aug-2012 Rich Felker <dalias@aerifal.cx>

remove configure check disabling shared libraries on mips


# a1546e8d 12-Jul-2012 Rich Felker <dalias@aerifal.cx>

disable dynamic linking on mips for now (broken)


# 6315004f 11-Jul-2012 Rich Felker <dalias@aerifal.cx>

initial version of mips (o32) port, based on work by Richard Pennington (rdp)

basically, this version of the code was obtained by starting with
rdp's work from his ellcc source tree, adapting it to musl's build
system and coding style, auditing the bits headers for discrepencies
with kernel definitions or glibc/LSB ABI or large file issues, fixing
up incompatibility with the old binutils from aboriginal linux, and
adding some new special cases to deal with the oddities of sigaction
and pipe syscall interfaces on mips.

at present, minimal test programs work, but some interfaces are broken
or missing. threaded programs probably will not link.


# 2121b8a4 03-Jul-2012 Rich Felker <dalias@aerifal.cx>

configure: only use -ffloat-store on i386

this option is expensive and only used on old gcc's that lack
-fexcess-precision=standed, but it's not needed on non-i386 archs
where floating point does not have excess precision anyway.

if musl ever supports m68k, i think it will need to be special-cased
too. i'm not aware of any other archs with excess precision.


# 498a100d 06-Jun-2012 Rich Felker <dalias@aerifal.cx>

check for ld support of -Bsymbolic-functions; disable shared if not avail

this issue affects the last gpl2 version of binutils, which some
people are still using out of aversion to gpl3. musl requires
-Bsymbolic-functions because it's the only way to make a libc.so
that's able to operate prior to dynamic linking but that still behaves
correctly with respect to global vars that may be moved to the main
program via copy relocations.


# f1fd7577 06-Jun-2012 Rich Felker <dalias@aerifal.cx>

use -nostdlib in linker tests to avoid possible missing crt/lib issues


# 67a0383d 06-Jun-2012 Rich Felker <dalias@aerifal.cx>

avoid linking main program in linker tests

it's possible that the user has provided a compiler that does not have
any libc to link to, so linking a main program is a bad idea. instead,
generate an empty shared library with no dependencies.


# 0c5efde8 06-Jun-2012 Rich Felker <dalias@aerifal.cx>

make configure try to disable stack protector

in theory we could support stack protector in the libc itself, and
users wanting to experiment with such usage could add
-fstack-protector to CFLAGS intentionally. but to avoid breakage in
the default case, override broken distro-patched gcc that forces stack
protector on.


# 08f70a30 06-Jun-2012 Rich Felker <dalias@aerifal.cx>

add configure check for gnu linker hash style setting

some broken distro-provided toolchains have modified gcc to produce
only "gnu hash" dynamic hash table by default. as this is unsupported
by musl, that results in a non-working libc.so. we detect and switch
this on in configure rather than hard-coding it in the Makefile
because it's not supported by old binutils versions, but that might
not even be relevant since old binutils versions already fail from
-Bsymbolic-functions being missing. at some point I may review whether
this should just go in the Makefile...


# 278883d0 03-Jun-2012 Rich Felker <dalias@aerifal.cx>

fix configure build/host/target terminology usage


# c5f3add3 14-May-2012 Rich Felker <dalias@aerifal.cx>

yet another try to get the check for gcc right...


# 55e2f5e9 14-May-2012 Rich Felker <dalias@aerifal.cx>

fix error in last configure change (lack of escaping)


# bc63e4fa 13-May-2012 Rich Felker <dalias@aerifal.cx>

correct the check for gcc (previous version failed for cross compilers)


# b4ccc3c1 05-May-2012 Rich Felker <dalias@aerifal.cx>

add -frounding-math to build


# 64d2f8e8 04-May-2012 Rich Felker <dalias@aerifal.cx>

initial commit of configure script

this script is not based on autoconf; however it attempts to follow
the same interface contracts for ease of integration with build
systems. it is also not necessary to use musl. manually written
config.mak files are still supported, as is building without any
config.mak at all as long as you are happy with the default options
and you supply at least ARCH on the command line to make.