aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make/dependencies-basic.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-04-05 20:21:29 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-04-05 21:13:09 +0100
commitb0d709745fd7228ff451a4eb8693798e12e0b1db (patch)
tree5fe34292f65d762941facc0c530401b90701584b /reproduce/src/make/dependencies-basic.mk
parent6432d6ef0b33e9ec7b9ec443e8275c0bd4f63245 (diff)
GCC not building on GNU/Linux system with incomplete complier
On some GNU/Linux distros, the compiler is separated into `multilib' mode (for 32-bit and 64-bit support) and by default the extra component of the compiler is not installed! In such systems for now, we are just creating symbolic links to the host's compiler (similar to Mac). While testing, I noticed that we weren't passing a "$downloader" option to the downloading script of `dependencies.mk' and `dependencies-python.mk'. Also, I noticed that the Cython and Python-pkg-config packages didn't have setuptools as a dependency! Both have now been fixed. Also, Cython's tarball name is now all small-caps (as in all the other tarballs).
Diffstat (limited to 'reproduce/src/make/dependencies-basic.mk')
-rw-r--r--reproduce/src/make/dependencies-basic.mk33
1 files changed, 26 insertions, 7 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index d4830ca..f7f83ed 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -793,16 +793,35 @@ $(ibidir)/gcc: $(gcc-prerequisites) \
# single architecture, we can trick GCC into building its libraries
# in '$(idir)/lib' by defining the '$(idir)/lib64' as a symbolic
# link to '$(idir)/lib'.
-
- # SO FAR WE HAVEN'T BEEN ABLE TO GET A CONSISTENT BUILD OF GCC ON
- # MAC (SOMETIMES IT CRASHES IN libiberty with g++) AND SOMETIMES IT
- # FINISHES, SO, MORE TESTS ARE NEEDED ON MAC AND WE'LL USE THE
- # HOST'S COMPILER UNTIL THEN.
+ #
+ # Cases were we currently don't build GCC:
+ #
+ # 1) MacOS: because it crashes sometimes while building libiberty
+ # with g++.
+ #
+ # 2) GNU/Linux distros that have `multilib' compilers (for 32-bit
+ # and 64-bit support) need to install a special package to have
+ # `/usr/include/sys/cdefs.h'. So we are explicitly testing a
+ # small C program to see if GCC can import it successfully.
if [ "x$(on_mac_os)" = xyes ]; then \
+ build=no; \
+ else \
+ tfile=$(ddir)/gcc-cdefs-test.c; \
+ echo "#include <sys/cdefs.h>" > $$tfile; \
+ echo "int main(void){return 0;}" >> $$tfile; \
+ if gcc $$tfile &> /dev/null; then \
+ build=yes; rm a.out; \
+ else build=no; \
+ fi; \
+ rm $$tfile; \
+ fi; \
+ \
+ if [ $$build = no ]; then \
$(call makelink,g++); \
+ $(call makelink,gcc); \
$(call makelink,gfortran); \
- $(call makelink,gcc,copy); \
- echo "" > $@; \
+ ccinfo=$$(gcc --version | awk 'NR==1'); \
+ echo "C compiler (""$$ccinfo"")" > $@; exit 1; \
else \
rm -f $(ibdir)/gcc* $(ibdir)/g++ $(ibdir)/gfortran $(ibdir)/gcov*;\
rm -rf $(ildir)/gcc $(ildir)/libcc* $(ildir)/libgcc*; \