Browse Source

Try to fix mips gcc troubles

Pierre Muller 3 years ago
parent
commit
982071d4a9
1 changed files with 41 additions and 12 deletions
  1. 41 12
      utils/fpcm/fpcmake.ini

+ 41 - 12
utils/fpcm/fpcmake.ini

@@ -844,9 +844,8 @@ endif
 [dirlibc]
 [dirlibc]
 # On linux, try to find where libgcc.a is.
 # On linux, try to find where libgcc.a is.
 ifeq ($(OS_SOURCE),linux)
 ifeq ($(OS_SOURCE),linux)
-
-# Amd64 to i386?
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
+# Amd64 to i386?
 ifeq ($(CPU_TARGET),i386)
 ifeq ($(CPU_TARGET),i386)
 ifneq ($(filter x86_64,$(shell uname -a)),)
 ifneq ($(filter x86_64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
@@ -854,27 +853,41 @@ GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
 CROSSGCCOPT=-m32
 CROSSGCCOPT=-m32
 endif
 endif
+#BINUTILSPREFIX
 endif
 endif
+#filter x86_64
 endif
 endif
+#CPU_TARGET=i386
 ifeq ($(CPU_TARGET),powerpc)
 ifeq ($(CPU_TARGET),powerpc)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
 CROSSGCCOPT=-m32
 CROSSGCCOPT=-m32
 endif
 endif
+#BINUTILSPREFIX
 endif
 endif
+#CPU_TARGET=powerpc
 ifeq ($(CPU_TARGET),powerpc64)
 ifeq ($(CPU_TARGET),powerpc64)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
 else
 else
 CROSSGCCOPT=-m64
 CROSSGCCOPT=-m64
 endif
 endif
+#BINUTILSPREFIX
 endif
 endif
+#CPU_TARGET=powerpc64
 ifeq ($(CPU_TARGET),sparc)
 ifeq ($(CPU_TARGET),sparc)
 ifneq ($(filter sparc64,$(shell uname -a)),)
 ifneq ($(filter sparc64,$(shell uname -a)),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 else
 else
+CROSSGCCOPT=-m32
+endif
+#BINUTILSPREFIX
+endif
+#filter sparc64
+endif
+#CPU_TARGET=sparc
 # gcc mips seems not to recognize -m32/-m64
 # gcc mips seems not to recognize -m32/-m64
 ifneq ($(filter $(CPU_TARGET),mips64 mipsel64),)
 ifneq ($(filter $(CPU_TARGET),mips64 mipsel64),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
@@ -882,7 +895,9 @@ GCCLIBDIR:=$(shell dirname `gcc -mabi=64 -print-libgcc-file-name`)
 else
 else
 CROSSGCCOPT=-mabi=64
 CROSSGCCOPT=-mabi=64
 endif
 endif
-else
+#BINUTILSPREFIX
+endif
+#CPU_TARGET=mips64,mips64el
 # gcc mips seems not to recognize -m32/-m64
 # gcc mips seems not to recognize -m32/-m64
 ifneq ($(filter $(CPU_TARGET),mips mipsel),)
 ifneq ($(filter $(CPU_TARGET),mips mipsel),)
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
@@ -890,18 +905,23 @@ GCCLIBDIR:=$(shell dirname `gcc -mabi=32 -print-libgcc-file-name`)
 else
 else
 CROSSGCCOPT=-mabi=32
 CROSSGCCOPT=-mabi=32
 endif
 endif
-else
+#BINUTILSPREFIX
+endif
+#CPU_TARGET=mips,mipsel
 ifeq ($(BINUTILSPREFIX),)
 ifeq ($(BINUTILSPREFIX),)
+ifeq ($(GCCLIBDIR),)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+endif
+#GCCLIBDIR=
 else
 else
+ifeq ($(CROSSGCCOPT),)
 CROSSGCCOPT=-m32
 CROSSGCCOPT=-m32
 endif
 endif
+#CROSSGCCOPT=
 endif
 endif
+#BINUTILSPREFIX
 endif
 endif
-endif
-endif
-endif
-endif
+#GCCLIBDIR=
 
 
 # Check if FPCFPMAKE compiler is same target as FPC
 # Check if FPCFPMAKE compiler is same target as FPC
 ifdef FPCFPMAKE
 ifdef FPCFPMAKE
@@ -913,27 +933,34 @@ else
 ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
 ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
 FPCMAKE_CROSSGCCOPT=-m64
 FPCMAKE_CROSSGCCOPT=-m64
 else
 else
-ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
+ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips64 mips64el),)
 FPCMAKE_CROSSGCCOPT=-mabi=64
 FPCMAKE_CROSSGCCOPT=-mabi=64
 else
 else
-ifneq ($(filter $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+ifneq ($(filter $(FPCFPMAKE_CPU_TARGET),mips mipsel),)
 FPCMAKE_CROSSGCCOPT=-mabi=32
 FPCMAKE_CROSSGCCOPT=-mabi=32
 else
 else
-ifeq ($(FPCFPMAKE_CPU_OPT),riscv64)
+ifeq ($(FPCFPMAKE_CPU_TARGET),riscv64)
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 FPCMAKE_CROSSGCCOPT=-mabi=lp64
 else
 else
-ifeq ($(FPCFPMAKE_CPU_OPT),riscv32)
+ifeq ($(FPCFPMAKE_CPU_TARGET),riscv32)
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 FPCMAKE_CROSSGCCOPT=-mabi=ilp32
 else
 else
 FPCMAKE_CROSSGCCOPT=-m32
 FPCMAKE_CROSSGCCOPT=-m32
 endif
 endif
+#riscv32
 endif
 endif
+#riscv64
 endif
 endif
+#mips/mipsel
 endif
 endif
+#mips64/mips64el
 endif
 endif
+#64-bit targets
 FPCMAKEGCCLIBDIR:=$(shell dirname `gcc $(FPCMAKE_CROSSGCCOPT) -print-libgcc-file-name`)
 FPCMAKEGCCLIBDIR:=$(shell dirname `gcc $(FPCMAKE_CROSSGCCOPT) -print-libgcc-file-name`)
 endif
 endif
+#not CPU_TARGET=FPCFPMAKE_CPU_TARGET
 endif
 endif
+#def FPCFPMAKE
 
 
 ifndef FPCMAKEGCCLIBDIR
 ifndef FPCMAKEGCCLIBDIR
 FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
 FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
@@ -945,7 +972,9 @@ CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEAR
 ifneq ($(CROSSGCC),)
 ifneq ($(CROSSGCC),)
 GCCLIBDIR:=$(shell dirname `$(CROSSGCC) $(CROSSGCCOPT) -print-libgcc-file-name`)
 GCCLIBDIR:=$(shell dirname `$(CROSSGCC) $(CROSSGCCOPT) -print-libgcc-file-name`)
 endif
 endif
+#CROSSGCC=
 endif
 endif
+#ndef GCCLIBDIR
 endif
 endif
 #ifeq($(OS_SOURCE),linux)
 #ifeq($(OS_SOURCE),linux)