Skip to content

Commit

Permalink
Merge pull request #643 from uyjulian/revert_iopglobal_changes
Browse files Browse the repository at this point in the history
[NFC] Revert "Merge pull request #639 from Wolf3s/gcc-acient"
  • Loading branch information
uyjulian authored Jul 5, 2024
2 parents 6bb16fe + 684fda1 commit 4d500a4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions samples/Makefile.iopglobal_sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ IOP_OBJS_DIR ?= obj/
IOP_SRC_DIR ?= ./
IOP_INC_DIR ?= include/

ifeq ($(IOP_CC_VERSION),3.2.2)
ASFLAGS_TARGET = -march=r3000
endif

ifeq ($(IOP_CC_VERSION),3.2.3)
ASFLAGS_TARGET = -march=r3000
endif

# include dir
IOP_INCS := $(IOP_INCS) -I$(PS2SDK)/iop/include -I$(PS2SDK)/common/include \
-I. -I$(IOP_INC_DIR)
Expand All @@ -32,10 +40,29 @@ IOP_CFLAGS := -D_IOP -fno-builtin -G0 $(IOP_OPTFLAGS) $(IOP_WARNFLAGS) $(IOP_DBG
# linker flags
IOP_LDFLAGS := -nostdlib -s $(IOP_LDFLAGS)

# Additional C compiler flags for GCC >=v5.3.0
# -msoft-float is to "remind" GCC/Binutils that the soft-float ABI is to be used. This is due to a bug, which
# results in the ABI not being passed correctly to binutils and iop-as defaults to the hard-float ABI instead.
# -mno-explicit-relocs is required to work around the fact that GCC is now known to
# output multiple LO relocs after one HI reloc (which the IOP kernel cannot deal with).
# -fno-toplevel-reorder (for IOP import and export tables only) disables toplevel reordering by GCC v4.2 and later.
# Without it, the import and export tables can be broken apart by GCC's optimizations.
ifneq ($(IOP_CC_VERSION),3.2.2)
ifneq ($(IOP_CC_VERSION),3.2.3)
IOP_CFLAGS += -msoft-float -mno-explicit-relocs
IOP_IETABLE_CFLAGS := -fno-toplevel-reorder
endif
endif

# If gpopt is requested, use it if the GCC version is compatible
ifneq (x$(IOP_PREFER_GPOPT),x)
ifeq ($(IOP_CC_VERSION),3.2.2)
IOP_CFLAGS += -DUSE_GP_REGISTER=1 -mgpopt -G$(IOP_PREFER_GPOPT)
endif
ifeq ($(IOP_CC_VERSION),3.2.3)
IOP_CFLAGS += -DUSE_GP_REGISTER=1 -mgpopt -G$(IOP_PREFER_GPOPT)
endif
endif

# Assembler flags
IOP_ASFLAGS := $(ASFLAGS_TARGET) -EL -G0 $(IOP_ASFLAGS)
Expand Down

0 comments on commit 4d500a4

Please sign in to comment.