Tiny Core Base > Raspberry Pi
troubleshooting compilation of gfortran
Juanito:
The x86 build notes are here: http://tinycorelinux.net/10.x/x86/tcz/src/gfortran
..and you could take a look at:
http://tinycorelinux.net/10.x/x86/tcz/gfortran.tcz.info
http://tinycorelinux.net/10.x/x86/tcz/gfortran-lib.tcz.info
On piCore, you would need something like:
--- Code: ---CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" ../configure --prefix=/usr/local --enable-languages=c,c++,fortran --disable-multilib --disable-bootstrap --with-system-zlib --libexecdir=/usr/local/lib
--- End code ---
xenodius:
Juanito, those compile notes are a gem, thank you for pointing them out!
Is the purpose of these lines:
--- Code: ---find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \;
find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \;
--- End code ---
to replace the flags on the below variables? Just curious why this is necessary.
At any rate, no matter what I did, 'make' just looped back through the ./configure output:
--- Code: ---tc@box:/mnt/mmcblk0p2/build/gcc/gcc-10.2.0$ sudo make -j4
make: Warning: File 'Makefile.in' has modification time 1595482727 s in the future
CONFIG_SHELL="/bin/bash" /bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --prefix=/usr/local --disable-multilib --disable-bootstrap --with-system-zlib --libexecdir=/usr/local/lib --enable-languages=c,c++,fortran,lto --no-create --no-recursion
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
..........................
configure: creating ./config.status
CONFIG_FILES=Makefile CONFIG_HEADERS= /bin/bash ./config.status
config.status: creating Makefile
make: Warning: File 'Makefile.in' has modification time 1595482719 s in the future
CONFIG_SHELL="/bin/bash" /bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --prefix=/usr/local --disable-multilib --disable-bootstrap --with-system-zlib --libexecdir=/usr/local/lib --enable-languages=c,c++,fortran,lto --no-create --no-recursion
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
............................
configure: creating ./config.status
CONFIG_FILES=Makefile CONFIG_HEADERS= /bin/bash ./config.status
config.status: creating Makefile
--- End code ---
I eventually realized that the reason for this loop, was that the timestamps were too old. Everything was ~1970. Somehow 'make' realized that this was older than the current time, yet simultaneously all created files still had this old timestamp. So it'd create a configuration, see it's 50 years old and decide to recreate it, see the new file is 50 years old, repeat... After setting the time with 'date', and starting over with re-extracted source it appears to be working. I knew it was some silly detail! Thank you all for your suggestions-- they are greatly appreciated, I have learned something from each of your posts here and elsewhere. I will try to configure my RTC so that the time persists accurately.
This is sort of offtopic, but about NTC updating-- It seems it takes the pi >60 seconds to connect to my wifi, so my time is never updated on boot. Is there a way to postpone the NTC time update timeout beyond 60 seconds?
Rich:
Hi xenodius
--- Quote from: xenodius on December 27, 2020, 12:10:33 PM --- ... to replace the flags on the below variables? Just curious why this is necessary. ...
--- End quote ---
It finds and removes those 2 flags. I think those flags in the Makefile and config file might override flags you export. We typically
compile with the -Os flag (smaller executable).
--- Quote --- ... Somehow 'make' realized that this was older than the current time ...
--- End quote ---
Yes, make checks timestamps to determine what does or does not need to be rebuilt.
xenodius:
I am still getting the following error after about a half hour:
--- Code: ---configure: error: C preprocessor "/lib/cpp" fails sanity check
--- End code ---
Solutions to this error for other packages/distros suggested symlinking issue. The following link causes make to fail the sanity check almost immediately:
--- Code: ---sudo ln -s /lib/cpp /usr/local/bin/cpp
--- End code ---
In config.log, most cache variables have nothing after '=';
--- Code: ---ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
--- End code ---
So in output variables:
--- Code: ---CPPFLAGS=''
--- End code ---
Based on other cases users have actually had to clear CPPFLAGS/CPP environmental variables in order to compile correctly... which makes sense, I think gcc should be using the corresponding cpp source downloaded via the download_prerequisites script, not the 9.2.0 version of cpp included in gcc.tcz. And as near as I can tell from the logs, it is. If I understand the configure operation and config.log correctly, it is clearing these environmental variables (='' in config.log output variables). Probably this is reason enough not to have tried the symlink, but since it did cause it to fail faster I think I might be on the right track and it's an issue with links/environmental variables. But nothing I've tried/adapted from similar errors in other packages/distributions has worked so far. Including clearing these environmental variables, directing to /usr/local/bin/cpp, and resetting piCore to a recent backup before I touched any environmental variables. :-[
Rich:
Hi xenodius
I have to ask, you're not using the values shown in the CC and CXX flags supplied in this link:
http://tinycorelinux.net/10.x/x86/tcz/src/gfortran/compile_gfortran
This build script for gcc shows CFLAGS and CXXFLAGS suitable for armv7 being exported.
http://repo.tinycorelinux.net/8.x/armv7/tcz/src/gcc/gcc630.build
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version