Commit Graph

673 Commits

Author SHA1 Message Date
Mike Frysinger 0c45c7ce67 libgloss: merge mn10200 configure script up a level
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.
2022-02-16 20:16:05 -05:00
Mike Frysinger 9a5f78d80e libgloss: merge m68k configure script up a level
Move the minor m68k-specific logic to a dedicated file & namespace them
so we can merge its configure logic up a level.
2022-02-16 20:14:55 -05:00
Mike Frysinger 7d565fe013 libgloss: m68k: switch to AC_NO_EXECUTABLES
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.
2022-02-16 20:12:42 -05:00
Mike Frysinger 91019da446 libgloss: merge mcore configure script up a level
Move the minor mcore-specific logic to a dedicated file & namespace them
so we can merge its configure logic up a level.
2022-02-16 20:11:55 -05:00
Mike Frysinger e7f8999918 libgloss: merge moxie configure script up a level
Move the minor moxie-specific logic to a dedicated file & namespace them
so we can merge its configure logic up a level.
2022-02-16 20:10:48 -05:00
Mike Frysinger 5200f756cc libgloss: merge i386 configure script up a level
Move the minor i386-specific logic to a dedicated variable so we can
merge its configure logic up a level.
2022-02-16 20:08:55 -05:00
Mike Frysinger e05f9c0c05 libgloss: i386: simplify target flags
Collapse these 3 settings into one variable to make it easier to
merge into the top-level.
2022-02-16 20:08:18 -05:00
Mike Frysinger 907764ebec newlib/libgloss: drop unused $(CROSS_CFLAGS)
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.
2022-02-15 20:02:51 -05:00
Mike Frysinger d4fa7379b0 libgloss: bfin: fix various warnings
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
2022-02-12 01:34:21 -05:00
Mike Frysinger 395ce0f4c0 libgloss: bfin: fix local header usage after automake move
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>
2022-02-12 01:29:33 -05:00
Mike Frysinger 5365a7deee libgloss: merge csky configure script up a level
Now that the csky-specific logic ($DO) has been deleted, we can fold
it up a level easily enough.
2022-02-11 06:19:01 -05:00
Mike Frysinger 66dfedc287 libgloss: merge bfin into top-level Makefile
Avoid a recursive make to speed things up a bit.
2022-02-11 06:14:55 -05:00
Mike Frysinger 62e580f01b libgloss: merge iq2000 into top-level Makefile
Avoid a recursive make to speed things up a bit.
2022-02-11 06:14:55 -05:00
Mike Frysinger f8aede7855 libgloss: merge libnosys into top-level Makefile
Avoid a recursive make to speed things up a bit.
2022-02-11 04:29:37 -05:00
Mike Frysinger ad28934ad3 libgloss: csky: clean up unused m68k logic
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.
2022-02-11 04:17:44 -05:00
Mike Frysinger 492e5fe8b0 libgloss: merge doc into top-level Makefile
Avoid a recursive make with this tiny subdir to speed things up a bit.
2022-02-09 20:01:40 -05:00
Mike Frysinger 7517551007 libgloss: convert top level to automake
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
2022-02-09 20:01:40 -05:00
Mike Frysinger a49c5fcdb5 libgloss: m68k: rename $DO to $TARGET
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.
2022-02-09 20:00:43 -05:00
Mike Frysinger 67c600b995 libgloss: restore multilib settings in subdir makefiles
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.
2022-02-04 19:33:29 -05:00
Mike Frysinger 8622002ffc libgloss: move to ../config/multi.m4 for multilib logic
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.
2022-02-01 23:07:11 -05:00
Mike Frysinger 30f244155b libgloss: merge subdirs that have unique makefile_frags up a level
Merge the subdir configure scripts up that only existed to set unique
values for their target/host makefile_frags.
2022-02-01 23:06:21 -05:00
Mike Frysinger d5a20f0b70 libgloss: merge epiphany & libnosys & or1k configure scripts up a level
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.
2022-02-01 21:53:22 -05:00
Mike Frysinger 502cf4b7b5 libgloss: fix more missing dir with parallel install
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.
2022-01-29 01:33:49 -05:00
Mike Frysinger 580817ec01 libgloss: update Makefile regen rules for merged arches
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.
2022-01-29 00:10:59 -05:00
Jeff Law 063d67faf0 Finish this commit by prefixing HAVE_INITFINI_ARRAY and HAVE_INIT_FINI references in libgloss in the same way.
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.
2022-01-28 21:39:14 -07:00
Mike Frysinger 9d33524164 libgloss: aarch64/sparc: fix missing dir with parallel install
Depending on the processing order of rules when installing in parallel,
install-board might run first and the target dirs don't yet exist.
2022-01-28 06:21:41 -05:00
Mike Frysinger c6c414fcb3 libgloss: bfin: fix missing dir with parallel install
Depending on the processing order of rules when installing in parallel,
install-board might run first and the target dirs don't yet exist.
2022-01-28 05:57:37 -05:00
Dimitar Dimitrov b095628ecf libgloss: Fix PRU & Blackfin mkinstalldirs path
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>
2022-01-27 19:40:10 -05:00
Mike Frysinger 43ab30fbd5 libgloss: merge stub iq2000 configure scripts up a level
This was supposed to be included in the previous commit.
2022-01-26 04:42:09 -05:00
Mike Frysinger 754f8def0d libgloss: merge stub arch configure scripts up a level
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.
2022-01-26 04:32:54 -05:00
Mike Frysinger c0bf2d68f9 libgloss: iq2000: drop unused configure vars
This will make it easier to merge up as it won't have unique settings.
2022-01-26 04:27:50 -05:00
Mike Frysinger 6d8c4e4ba1 libgloss: define default target_makefile_frag in top-level
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.
2022-01-25 21:56:47 -05:00
Mike Frysinger dfa088ab66 libgloss: bfin: fix subdir install for sim files
When building in parallel, make sure the subdir for the sim files
exist before trying to install into them.
2022-01-23 21:08:07 -05:00
Mike Frysinger 7c02fc3075 libgloss: clean up redundant shared lib warnings
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.
2022-01-17 04:30:37 -05:00
Mike Frysinger a100e80fc9 require autoconf-2.69 exactly
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.
2022-01-14 15:24:33 -05:00
Mike Frysinger 7f8fa1de4f libgloss: hardcode AC_CONFIG_AUX_DIR path
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.
2022-01-10 19:50:35 -05:00
Mike Frysinger 8c57b8b2b4 libnosys: update autoheader usage
The use of acconfig.h templates is deprecated, so migrate away from it
by moving the description text to configure.ac.
2022-01-07 15:54:57 -05:00
Mike Frysinger 0221728233 libgloss: wince: add ACLOCAL_AMFLAGS settings
This allows autoreconf to "just work" and find the right macros.
2022-01-07 15:54:57 -05:00
Mike Frysinger e29279b011 libgloss: wince: update to automake-1.15
Drop the cygnus options and migrate to current versions of autotools.
2021-12-29 23:22:44 -05:00
Mike Frysinger 873da400e0 libgloss: regenerate aclocal.m4 & configure w/newer versions
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
2021-11-06 14:14:50 -04:00
Mike Frysinger 59e83de0b1 libgloss/newlib: update configure.ac in Makefile.in files
The maintainer rules refer to configure.in directly, so update that
after renaming all the configure.ac files.
2021-11-06 14:14:49 -04:00
Lewis Revill 92e488d5b8 libgloss/riscv: Fix hard coded reference to configure.in after rename
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.
2021-10-27 17:44:48 +02:00
Mike Frysinger 1328009bb4 libgloss: add missing aclocal.m4 files
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.
2021-09-15 10:08:20 -04:00
Mike Frysinger e215765041 libgloss: epiphany: rename symbol prefix cache var
Autoconf emits a warning for this:
configure.ac:75: warning: AC_CACHE_VAL(libc_symbol_prefix, ...): suspicious cache-id, must contain _cv_ to be cached

Rename the variable to match the naming in libnosys/ subdir.
2021-09-15 10:08:20 -04:00
Mike Frysinger 63c1f29a1d libgloss: fix AC_LANG_SOURCE warnings w/newer autoconf
When running autoconf-2.69 in here, we get:
configure.ac:57: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2503: _AC_PREPROC_IFELSE is expanded from...
../../lib/autoconf/general.m4:2518: AC_PREPROC_IFELSE is expanded from...
configure.ac:57: the top level
configure.ac:61: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2503: _AC_PREPROC_IFELSE is expanded from...
../../lib/autoconf/general.m4:2518: AC_PREPROC_IFELSE is expanded from...
configure.ac:61: the top level

Add AC_LANG_PROGRAM wrappings to fix these.
2021-09-15 10:08:20 -04:00
Mike Frysinger 920617998e libgloss/newlib: rename configure.in to configure.ac
The .in name has been deprecated for a long time in favor of .ac.
2021-09-13 10:14:37 -04:00
Christoph Muellner 0cb40f415b RISC-V: Reliably initialize t0 in _times()
The current implementation does not reliably initialize t0 once.
Additionally the initialization requires two calls to _gettimeofday().
Let's sacrifice a byte to keep the initialization status
and reduce the maximum number of calls to _gettimeofday().

This has caused issues in an application that invokes clock().
The problematic situation is as follows:

1) The program calls clock() which calls _times().
2) _gettimeofday(&t0, 0) puts 0 in t0.tv_usec (because less than 1 us has
   elapsed since the beginning of time).
3) _gettimeofday(&t, 0) puts 1 in t.tv_usec (since now more than 1 us has
   elapsed since the beginning of time).
4) That call to clock() returns 1 (the value from step 3 minus the value in
   step 2).
5) The program does a second call to clock().
6) The code above still sees 0 in t0 so it tries to update t0 again and
   _gettimeofday(&t0, 0) puts 1 in t0.tv_usec.
7) The _gettimeofday(&t, 0) puts 1 in t.tv_usec (since less than 1us has
   elapsed since step 3).
8) clock() returns 0 (step 7 minus step 6) and indicates that time is
   moving backwards.

Signed-off-by: Christoph Muellner <cmuellner@gcc.gnu.org>
2021-08-04 11:44:33 +02:00
Jeff Law c01f603df9 Fix builds on iq2000 and visium
visium and iq2000 have libgloss configure bits that reference
target_makefile_frag, but it's never set. This leads to failures during the
configure process and an empty libgloss/<target>/Makefile.  Naturally bad
things happen with an empty Makefile.

This patch initializes target_makefile_frag for both targets in their
configure.in files and updates the generated configure files.  This fixes the
build failures.  I've been using it in my tester for about a week and both
targets have flipped from consistently failing to consistently passing.

    * libgloss/visium/configure.in (target_makefile_frag): Define.
    * libgloss/visium/configure: Regenerated.
    * libgloss/iq2000/configure.in (target_makefile_frag): Define.
    * libgloss/iq2000/configure: Regenerated.
2021-07-06 10:46:09 -04:00
Stafford Horne 43999b660f libgloss/or1k: Correct the IMMU SXE and UXE flags
These have been defined incorrectly, as per specification and CPU
implementations SXE is bit 6 and UXE is bit 7.  This was noticed when
tracking down our test suite mmu test failures.

 Test Suite: https://github.com/openrisc/or1k-tests/blob/master/native/or1k/or1k-mmu.c#L68-L72
 Spec: https://raw.githubusercontent.com/openrisc/doc/master/openrisc-arch-1.3-rev1.pdf

See section 8.4.8 Instruction Translation Lookaside Buffer Way y Translate
Registers where these are defined.

Signed-off-by: Stafford Horne <shorne@gmail.com>
2021-07-05 18:00:40 -04:00
Dimitar Dimitrov df0ad84e91 libgloss: pru: Remove sim ld script
Binutils LD default linker script was recently fixed to allow memory
sizes to be set via command line. Use this feature to remove the special
sim linker script in libgloss.

It is acceptable to require newer Binutils version here because simulator
target is only used for regression testing the toolchain. Real HW
targets are not affected.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-06-09 14:15:56 -04:00