Open TommyMurphyTM1234 opened 3 months ago
Pointer for further analysis (I have not reproduced the issue yet): the relevant Makefile is libstdc++-v3/src/c++11/Makefile.am
(GCC).
Things to analyse:
Makefile
equal in both cases?ENABLE_DUAL_ABI
being set in both cases?Also, does this happen with upstream/master
?
Thanks for the feedback @cmuellner.
Pointer for further analysis (I have not reproduced the issue yet): the relevant Makefile is
libstdc++-v3/src/c++11/Makefile.am
(GCC).Things to analyse:
- is the generated
Makefile
equal in both cases?
Do you mean the two cases of with and without CXXFLAGS_FOR_TARGET_EXTRA=-v
?
- is
ENABLE_DUAL_ABI
being set in both cases?
Ditto?
Also, does this happen with
upstream/master
?
Do you mean when using something like the following?
git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
git clone https://github.com/gcc-mirror/gcc gcc-master --depth=1
./configure ... --with-gcc-src=`pwd`/gcc-master
I can look into these issues soon.
FWIW:
git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=`pwd`/installed-tools --disable-gdb
make 2>&1 | tee build.log
cp build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/Makefile Makefile-without-v
make distclean
rm -rf installed-tools
make CXXFLAGS_FOR_TARGET_EXTRA=-v 2>&1 | tee build.log
...
Compiler executable checksum: d5806b54b201f879501338c7bbc69a9b
COMPILER_PATH=/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/
LIBRARY_PATH=/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/
COLLECT_GCC_OPTIONS='-shared-libgcc' '-B' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc' '-nostdinc++' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/.libs' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/libsupc++/.libs' '-B' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/' '-B' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/' '-isystem' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/include' '-isystem' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/sys-include' '-I' '/home/user/Downloads/riscv-gnu-toolchain/gcc/libstdc++-v3/../libgcc' '-I' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/include/riscv64-unknown-elf' '-I' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/include' '-I' '/home/user/Downloads/riscv-gnu-toolchain/gcc/libstdc++-v3/libsupc++' '-std=gnu++11' '-fno-implicit-templates' '-Wall' '-Wextra' '-Wwrite-strings' '-Wcast-qual' '-Wabi=2' '-fdiagnostics-show-location=once' '-ffunction-sections' '-fdata-sections' '-frandom-seed=cxx11-ios_failure-lt.s' '-Os' '-v' '-mcmodel=medlow' '-gno-as-loc-support' '-S' '-mtune=rocket' '-march=rv64imafdc_zicsr' '-mabi=lp64d' '-misa-spec=20191213' '-march=rv64imafdc_zicsr'
libtool: compile: mv -f "cxx11-ios_failure.o" "tmp-cxx11-ios_failure-lt.o"
mv: cannot stat 'cxx11-ios_failure.o': No such file or directory
make[6]: *** [Makefile:876: cxx11-ios_failure-lt.s] Error 1
make[6]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/c++11'
make[5]: *** [Makefile:792: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src'
make[4]: *** [Makefile:576: all-recursive] Error 1
make[4]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3'
make[3]: *** [Makefile:501: all] Error 2
make[3]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3'
make[2]: *** [Makefile:12289: all-target-libstdc++-v3] Error 2
make[2]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2'
make[1]: *** [Makefile:1035: all] Error 2
make[1]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2'
make: *** [Makefile:742: stamps/build-gcc-newlib-stage2] Error 2
cp build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/Makefile Makefile-with-v
diff Makefile-with-v Makefile-without-v
228c228
< CXXFLAGS = -Os -v -mcmodel=medlow
---
> CXXFLAGS = -Os -mcmodel=medlow
I tried with the latest upstream master
branch GCC sources but got the same failure:
git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
git clone https://github.com/gcc-mirror/gcc gcc-master --depth=1
./configure --prefix=`pwd`/installed-tools --disable-gdb --with-gcc-src=`pwd`/gcc-master
make CXXFLAGS_FOR_TARGET_EXTRA=-v 2>&1 | tee build.log
...
Compiler executable checksum: 5d95cf1bb896048a8e56b563a3db2113
COMPILER_PATH=/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/
LIBRARY_PATH=/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/:/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/
COLLECT_GCC_OPTIONS='-shared-libgcc' '-B' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/./gcc' '-nostdinc++' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/.libs' '-L/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/libsupc++/.libs' '-B' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/bin/' '-B' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/lib/' '-isystem' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/include' '-isystem' '/home/user/Downloads/riscv-gnu-toolchain/installed-tools/riscv64-unknown-elf/sys-include' '-I' '/home/user/Downloads/riscv-gnu-toolchain/gcc-master/libstdc++-v3/../libgcc' '-I' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/include/riscv64-unknown-elf' '-I' '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/include' '-I' '/home/user/Downloads/riscv-gnu-toolchain/gcc-master/libstdc++-v3/libsupc++' '-std=gnu++11' '-fno-implicit-templates' '-Wall' '-Wextra' '-Wwrite-strings' '-Wcast-qual' '-Wabi=2' '-fdiagnostics-show-location=once' '-ffunction-sections' '-fdata-sections' '-frandom-seed=cxx11-ios_failure-lt.s' '-Os' '-v' '-mcmodel=medlow' '-gno-as-loc-support' '-S' '-mtune=rocket' '-march=rv64imafdc_zicsr_zaamo_zalrsc' '-mabi=lp64d' '-misa-spec=20191213' '-march=rv64imafdc_zicsr_zaamo_zalrsc_zca_zcd'
libtool: compile: mv -f "cxx11-ios_failure.o" "tmp-cxx11-ios_failure-lt.o"
mv: cannot stat 'cxx11-ios_failure.o': No such file or directory
make[6]: *** [Makefile:899: cxx11-ios_failure-lt.s] Error 1
make[6]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src/c++11'
make[5]: *** [Makefile:797: all-recursive] Error 1
make[5]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3/src'
make[4]: *** [Makefile:577: all-recursive] Error 1
make[4]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3'
make[3]: *** [Makefile:502: all] Error 2
make[3]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/libstdc++-v3'
make[2]: *** [Makefile:12244: all-target-libstdc++-v3] Error 2
make[2]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2'
make[1]: *** [Makefile:1055: all] Error 2
make[1]: Leaving directory '/home/user/Downloads/riscv-gnu-toolchain/build-gcc-newlib-stage2'
make: *** [Makefile:742: stamps/build-gcc-newlib-stage2] Error 2
To summarise:
Things to analyse:
- is the generated
Makefile
equal in both cases?
Yes, apart from CXXFLAGS = -Os
in one case and CXXFLAGS = -Os -v
in the other.
- is
ENABLE_DUAL_ABI
being set in both cases?
It's not set in either case.
Also, does this happen with
upstream/master
?
Yes - same error.
I've cloned and configured the latest sources:
And then I have tried four different builds (doing
make distclean && rm -rf installed-tools
before each for a clean build):make 2>&1 | tee build.log
:build.log
make ASFLAGS_FOR_TARGET_EXTRA=-v 2>&1 | tee build-extra-asflags.log
:build-extra-asflags.log
make CFLAGS_FOR_TARGET_EXTRA=-v 2>&1 | tee build-extra-cflags.log
:build-extra-cflags.log
make CXXFLAGS_FOR_TARGET_EXTRA=-v 2>&1 | tee build-extra-cxxflags.log
:build-extra-cxxflags.log
The first three complete successfully (and give verbose output for the relevant tools) but the fourth and last one fails:
Anybody got any idea why? This seems odd - the output file is
cxx11-ios_failure.s
but the it tries to copycxx11-ios_failure.o
:I.e. the output file is
cxx11-ios_failure.s
but it tries to copycxx11-ios_failure.o
.