mirror of
https://github.com/mupen64plus/mupen64plus-video-arachnoid.git
synced 2024-06-02 19:27:49 -04:00
Add CXXFLAGS to the linker step
The GCC manual states for different parameters that the options for compilation must also be used when linking. The options for compilation are stored in CXXFLAGS and added to LINK.o to fix the behavior. Option which need this are for example -fPIC/-fPIE or -flto.
This commit is contained in:
parent
dfa22c9899
commit
d49a2b857f
|
@ -139,10 +139,10 @@ ifeq ($(OS), OSX)
|
|||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -framework OpenGL -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -framework OpenGL
|
||||
else
|
||||
CFLAGS += -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -framework OpenGL -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -framework OpenGL
|
||||
endif
|
||||
endif
|
||||
else
|
||||
|
@ -177,10 +177,8 @@ endif
|
|||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
||||
ifeq ($(PIC), 1)
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS += -fPIC
|
||||
else
|
||||
CFLAGS += -fno-PIC
|
||||
LDFLAGS += -fno-PIC
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
|
@ -217,7 +215,7 @@ ifneq ($(OS), FREEBSD)
|
|||
# tweak flags for 32-bit build on 64-bit system
|
||||
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32 -Wl,-m,elf_i386
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
endif
|
||||
else
|
||||
|
@ -243,7 +241,7 @@ INSTALL ?= install
|
|||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
# set special flags for given Makefile parameters
|
||||
ifeq ($(DEBUG),1)
|
||||
|
@ -386,7 +384,7 @@ CXXFLAGS += $(CFLAGS)
|
|||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += -fuse-linker-plugin $(CXXFLAGS)
|
||||
LDFLAGS += -fuse-linker-plugin
|
||||
endif
|
||||
|
||||
# standard build rules
|
||||
|
|
Loading…
Reference in a new issue