Move the minor wince-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level. The makefile
is a bit tricky, but maybe it still works.
We don't want libgloss building against C library headers that happened
to be installed with the toolchain, so add -nostdinc to the build. We
still need access to the compiler internal headers, so probe those and
include them via -isystem. This uses a similar probing style as glibc,
which has used it for over a decade, so it should be safe & stable.
This should prevent any latent bugs due to testing with a toolchain that
is fully configured & installed already.
The cpu-init/configure script isn't doing anything useful, so merge
the logic up to the parent dir. This is how the arm/ tree integrates
its cpu-init/ subdir too.
Move the minor mn10300-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level. part_specific_obj
wasn't used anywhere (looks like copy & paste left over from mips), so
drop it entirely.
The mn10200-specific logic (setting up part_specific_obj) isn't used
by the build anywhere -- looks like copy & paste left overs from mips.
So punt that & merge the target_makefile_frag_path up to the top-level.
Use this macro rather than hacking up the LDFLAGS settings. This will
make it easier to merge the logic into the top-level which is already
using AC_NO_EXECUTABLES.
This is used in a bunch of places, but nowhere is it ever set, and
nowhere can I find any documentation, nor can I find any other project
using it. So delete the flags to simplify.
No functional changes here, just fix warnings the compiler noticed.
bfin/syscalls.c:156:13: warning: conflicting types for built-in function ‘memset’
bfin/syscalls.c: In function ‘_unlink’:
bfin/syscalls.c:193:3: warning: passing argument 2 of ‘do_syscall’ discards qualifiers from pointer target type
bfin/syscalls.c:33:1: note: expected ‘void *’ but argument is of type ‘const char *’
bfin/syscalls.c: In function ‘_exit’:
bfin/syscalls.c:104:1: warning: ‘noreturn’ function does return
Compiling the basiccrt .S files missed an include to the local bfin/
headers causing the build to break when installing anew.
Reported-by: Jeff Law <jeffreyalaw@gmail.com>
It looks like csky was created by copying & pasting the m68k port,
but m68k-specific stuff was left over related to target selection.
The makefile doesn't do anything with it, so punt it all to make
the file much simpler.
The top level dir isn't doing anything interesting, just recursing into
subdirs. So this change isn't terribly exciting. But it sets us up for
doing more fun stuff in follow up commits.
[TODO] Check test targets
The common $DO variable is used by the multilib logic to control which
target to multiplex. But the m68k subdir is also using $DO to control
which target (m68k or fido) to build. As we flatten things to automake,
this conflict shows up and breaks the m68k build. Just rename the m68k
variable to something unique to avoid it.
Commit 754f8def0d ("libgloss: merge stub
arch configure scripts up a level") had an unintended side-effect: the
MULTI* variables in the Makefiles no longer get rewritten at configure
time in the subdirs. Only the top-level Makefile still is. This is
because the configure integration of multilib (both the way libgloss
did it manually and the way AM_ENABLE_MULTILIB does it) only rewrites
"Makefile".
We could try propagating the MULTI* variables from libgloss/Makefile
down via FLAGS_TO_PASS, but this runs into a limitation: the multilib
logic uses this variable to switch from libgloss/ to each multilib
libgloss/, and libgloss uses this variable to enter subdirectories.
The latter we want, but the former ends up overridding the Makefile
environment. We could side-step that with some GNU Make directives,
but it feels like we're getting a bit too deep down the rabbit hole.
Instead, let's call config-ml.in ourselves for each subdir Makefile
that the top-level configure generates. This restores the previous
behavior and should be less risky in general.
This logic should be unnecessary when/if we switch libgloss over to
a non-recursive Automake build (since all build+install settings are
in the single libgloss/Makefile), but it'll be a while before we can
land that rework, so let's fix this up now.
The current libgloss multilib logic is almost exactly the same as the
config/multi.m4, and the differences should be minor, so switch over
to that to delete custom logic on ourside.
The insertions here look larger and that's because none of the scripts
were declaring --enable-multilib explicitly even though they checked the
flag and changed behavior.
These subdirs have unique configure scripts to do some compiler tests.
The checks should work for all targets, so hoist them up to the top
libgloss dir. This should allow us to delete these subdir configure
scripts.
It means the top-level gains autoheader support, but that's fine.
It wasn't exporting any defines previously (i.e. -D into CPPFLAGS),
and all of the defines it now exports are only used by code in the
libnosys subdir which was expecting to have a config.h.
Depending on the processing order of rules when installing in parallel,
these install rules might be processed before some other rule happens
to create the respective dirs. Make sure each one creates the needed
dirs before installing into them.
For arches that had their configure merged into the top-level, make
sure they don't still depend on a subdir configure script that no
longer exists. I had cleaned this up for some of the subdirs, but
these got lost in the shuffle.
Author: Mike Frysinger <vapier@gentoo.org>
Date: Mon Jan 17 22:20:20 2022 -0500
newlib: internalize HAVE_INITFINI_ARRAY
This define is only used by newlib internally, so stop exporting it
as HAVE_INITFINI_ARRAY since this can conflict with defines packages
use themselves.
We don't really need to add _ to HAVE_INIT_FINI too since it isn't
exported in newlib.h, but might as well be consistent here.
We can't (easily) add this to newlib_cflags like HAVE_INIT_FINI is
because this is based on a compile-time test in the top configure,
not on plain shell code in configure.host. We'd have to replicate
the test in every subdir in order to have it passed down.
With the move of configure scripts out of target directories, relative
paths to top_srcdir got broken:
/bin/sh: .../newlib/libgloss/../../mkinstalldirs: No such file or directory
Fix the PRU build by switching to srcroot relative path, as rest of targets do.
Fix the Blackfin build in the same way.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
For about half the ports, we don't need a subdir configure script.
They're using the config/default.m[ht] rules, and they aren't doing
any unique configure tests, so they exist just to pass top-level
settings down to create the arch Makefile. We can just as easily
do that from the top-level Mkaefile directly and skip configure.
Most of the remaining configure scripts could be migrated up to
the top-level too, but that would require care in each subdir.
So let's be lazy and put that off to another day.
A bunch of subdirs want this, so make it available in the common
dir to ease future merges. It isn't used directly in libgloss so
it should be harmless as-is.
Use standard AC_MSG_WARN macro in the top-level configure, and delete
the message from all the subdirs. There's no need to issue this more
than once per libgloss build.
The newlib & libgloss dirs are already generated using autoconf-2.69.
To avoid merging new code and/or accidental regeneration using diff
versions, leverage config/override.m4 to pin to 2.69 exactly. This
matches what gcc/binutils/gdb are already doing.
The README file already says to use autoconf-2.69.
To accomplish this, it's just as simple as adding -I flags to the
top-level config/ dir when running aclocal. This is because the
override.m4 file overrides AC_INIT to first require the specific
autoconf version before calling the real AC_INIT.
In order to transition to automake, we have to use hardcoded paths in
the AC_CONFIG_AUX_DIR macro call (since automake evaluates the path
itself, and doesn't expand vars), so simplify all the calls here.
Regenerate the files using automake-1.15 & autoconf-2.69 to match the
binutils/gdb/gcc projects. Ran:
libgloss $ find -name configure.ac -printf '%h\n' | while read d; do
(cd $d; export WANT_AUTOCONF=2.69 WANT_AUTOMAKE=1.15;
aclocal-1.15 -I.. && autoconf-2.69); done
The file configure.in was renamed to configure.ac in libgloss/riscv but
the hard coded name in the Makefile for that directory was not updated.
This patch simply renamed this to configure.ac.
These subdirs were missing aclocal.m4 files pulling in macros from
../acinclude.m4 which caused some macros to not be expanded. For
example, autoconf complains:
configure.ac:25: error: possibly undefined macro: LIB_AC_PROG_CC
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
These were generated with aclocal-1.9 as that seems to be what was
used in these dirs previously, and with whatever version of autoconf
the specific subdir was using. This should minimize diffs.