The _open() C function is declared as having variable arguments in
newlib, so second and third arguments are passed on stack. Add code to
move them into registers, since that's where the PRU simulator expects
them.
Issue was exposed by the GCC test gcc.c-torture/execute/fprintf-2.c,
which relies on tmpnam implementation to pass correct flags to _open.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
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.
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
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>
In the initial code I missed one level of pointer indirection. Instead
of storing errno in impure_data, _impure_ptr was corrupted.
Only simulator is impacted. Real targets have no OS and no syscalls.
This resolves a bunch of stdio cases from the GCC testsuite:
FAIL->PASS: gcc.c-torture/execute/printf-2.c -O0 execution test
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>