Try to fix mips gcc troubles

This commit is contained in:
Pierre Muller 2022-02-21 18:08:56 +00:00 committed by FPK
parent 6f0f339fc4
commit 982071d4a9

View File

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