mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 676252 part 2 - Use a different object file extension for the first PGO build pass with GCC. r=ted
This commit is contained in:
parent
bc5bb72129
commit
394b75114c
@ -47,6 +47,7 @@ INTERNAL_TOOLS = 1
|
|||||||
|
|
||||||
HOST_PROGRAM = elfhack
|
HOST_PROGRAM = elfhack
|
||||||
NO_DIST_INSTALL = 1
|
NO_DIST_INSTALL = 1
|
||||||
|
NO_PROFILE_GUIDED_OPTIMIZE = 1
|
||||||
|
|
||||||
VPATH += $(topsrcdir)/build
|
VPATH += $(topsrcdir)/build
|
||||||
|
|
||||||
|
@ -350,7 +350,10 @@ _MSC_VER = @_MSC_VER@
|
|||||||
|
|
||||||
DLL_PREFIX = @DLL_PREFIX@
|
DLL_PREFIX = @DLL_PREFIX@
|
||||||
LIB_PREFIX = @LIB_PREFIX@
|
LIB_PREFIX = @LIB_PREFIX@
|
||||||
OBJ_SUFFIX = @OBJ_SUFFIX@
|
# We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
|
||||||
|
# manually use it before config.mk inclusion
|
||||||
|
OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX)
|
||||||
|
_OBJ_SUFFIX = @OBJ_SUFFIX@
|
||||||
LIB_SUFFIX = @LIB_SUFFIX@
|
LIB_SUFFIX = @LIB_SUFFIX@
|
||||||
DLL_SUFFIX = @DLL_SUFFIX@
|
DLL_SUFFIX = @DLL_SUFFIX@
|
||||||
BIN_SUFFIX = @BIN_SUFFIX@
|
BIN_SUFFIX = @BIN_SUFFIX@
|
||||||
|
@ -790,3 +790,21 @@ EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) --uselist -- $(MKSHLIB)
|
|||||||
ifdef STDCXX_COMPAT
|
ifdef STDCXX_COMPAT
|
||||||
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
|
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
|
||||||
|
# this file
|
||||||
|
OBJ_SUFFIX := $(_OBJ_SUFFIX)
|
||||||
|
|
||||||
|
# PGO builds with GCC build objects with instrumentation in a first pass,
|
||||||
|
# then objects optimized, without instrumentation, in a second pass. If
|
||||||
|
# we overwrite the ojects from the first pass with those from the second,
|
||||||
|
# we end up not getting instrumentation data for better optimization on
|
||||||
|
# incremental builds. As a consequence, we use a different object suffix
|
||||||
|
# for the first pass.
|
||||||
|
ifndef NO_PROFILE_GUIDED_OPTIMIZE
|
||||||
|
ifdef MOZ_PROFILE_GENERATE
|
||||||
|
ifdef GNU_CC
|
||||||
|
OBJ_SUFFIX := i_o
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
@ -93,7 +93,7 @@ class ExpandArgsMore(ExpandArgs):
|
|||||||
subprocess.call(ar_extract + [os.path.abspath(arg)], cwd=tmp)
|
subprocess.call(ar_extract + [os.path.abspath(arg)], cwd=tmp)
|
||||||
objs = []
|
objs = []
|
||||||
for root, dirs, files in os.walk(tmp):
|
for root, dirs, files in os.walk(tmp):
|
||||||
objs += [relativize(os.path.join(root, f)) for f in files if os.path.splitext(f)[1] == conf.OBJ_SUFFIX]
|
objs += [relativize(os.path.join(root, f)) for f in files if os.path.splitext(f)[1] in [conf.OBJ_SUFFIX, '.i_o']]
|
||||||
newlist += objs
|
newlist += objs
|
||||||
else:
|
else:
|
||||||
newlist += [arg]
|
newlist += [arg]
|
||||||
|
@ -46,7 +46,7 @@ from expandlibs import LibDescriptor
|
|||||||
def generate(args):
|
def generate(args):
|
||||||
desc = LibDescriptor()
|
desc = LibDescriptor()
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if os.path.splitext(arg)[1] == conf.OBJ_SUFFIX:
|
if os.path.splitext(arg)[1] in [conf.OBJ_SUFFIX, '.i_o']:
|
||||||
desc['OBJS'].append(os.path.abspath(arg))
|
desc['OBJS'].append(os.path.abspath(arg))
|
||||||
elif os.path.splitext(arg)[1] == conf.LIB_SUFFIX and \
|
elif os.path.splitext(arg)[1] == conf.LIB_SUFFIX and \
|
||||||
(os.path.exists(arg) or os.path.exists(arg + conf.LIBS_DESC_SUFFIX)):
|
(os.path.exists(arg) or os.path.exists(arg + conf.LIBS_DESC_SUFFIX)):
|
||||||
|
@ -421,7 +421,7 @@ endif
|
|||||||
ALL_TRASH = \
|
ALL_TRASH = \
|
||||||
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
||||||
$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
|
$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
|
||||||
$(OBJS:.$(OBJ_SUFFIX)=.i) \
|
$(OBJS:.$(OBJ_SUFFIX)=.i) $(OBJS:.$(OBJ_SUFFIX)=.i_o) \
|
||||||
$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
|
$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
|
||||||
$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
|
$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
|
||||||
$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
|
$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
|
||||||
@ -948,6 +948,15 @@ ifdef GNU_CC
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
|
||||||
|
ifdef GNU_CC
|
||||||
|
# Force rebuilding libraries and programs in both passes because each
|
||||||
|
# pass uses different object files.
|
||||||
|
$(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
endif # NO_PROFILE_GUIDED_OPTIMIZE
|
endif # NO_PROFILE_GUIDED_OPTIMIZE
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
|
@ -177,7 +177,10 @@ _MSC_VER = @_MSC_VER@
|
|||||||
|
|
||||||
DLL_PREFIX = @DLL_PREFIX@
|
DLL_PREFIX = @DLL_PREFIX@
|
||||||
LIB_PREFIX = @LIB_PREFIX@
|
LIB_PREFIX = @LIB_PREFIX@
|
||||||
OBJ_SUFFIX = @OBJ_SUFFIX@
|
# We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
|
||||||
|
# manually use it before config.mk inclusion
|
||||||
|
OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX)
|
||||||
|
_OBJ_SUFFIX = @OBJ_SUFFIX@
|
||||||
LIB_SUFFIX = @LIB_SUFFIX@
|
LIB_SUFFIX = @LIB_SUFFIX@
|
||||||
DLL_SUFFIX = @DLL_SUFFIX@
|
DLL_SUFFIX = @DLL_SUFFIX@
|
||||||
BIN_SUFFIX = @BIN_SUFFIX@
|
BIN_SUFFIX = @BIN_SUFFIX@
|
||||||
|
@ -790,3 +790,21 @@ EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) --uselist -- $(MKSHLIB)
|
|||||||
ifdef STDCXX_COMPAT
|
ifdef STDCXX_COMPAT
|
||||||
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
|
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
|
||||||
|
# this file
|
||||||
|
OBJ_SUFFIX := $(_OBJ_SUFFIX)
|
||||||
|
|
||||||
|
# PGO builds with GCC build objects with instrumentation in a first pass,
|
||||||
|
# then objects optimized, without instrumentation, in a second pass. If
|
||||||
|
# we overwrite the ojects from the first pass with those from the second,
|
||||||
|
# we end up not getting instrumentation data for better optimization on
|
||||||
|
# incremental builds. As a consequence, we use a different object suffix
|
||||||
|
# for the first pass.
|
||||||
|
ifndef NO_PROFILE_GUIDED_OPTIMIZE
|
||||||
|
ifdef MOZ_PROFILE_GENERATE
|
||||||
|
ifdef GNU_CC
|
||||||
|
OBJ_SUFFIX := i_o
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
@ -93,7 +93,7 @@ class ExpandArgsMore(ExpandArgs):
|
|||||||
subprocess.call(ar_extract + [os.path.abspath(arg)], cwd=tmp)
|
subprocess.call(ar_extract + [os.path.abspath(arg)], cwd=tmp)
|
||||||
objs = []
|
objs = []
|
||||||
for root, dirs, files in os.walk(tmp):
|
for root, dirs, files in os.walk(tmp):
|
||||||
objs += [relativize(os.path.join(root, f)) for f in files if os.path.splitext(f)[1] == conf.OBJ_SUFFIX]
|
objs += [relativize(os.path.join(root, f)) for f in files if os.path.splitext(f)[1] in [conf.OBJ_SUFFIX, '.i_o']]
|
||||||
newlist += objs
|
newlist += objs
|
||||||
else:
|
else:
|
||||||
newlist += [arg]
|
newlist += [arg]
|
||||||
|
@ -46,7 +46,7 @@ from expandlibs import LibDescriptor
|
|||||||
def generate(args):
|
def generate(args):
|
||||||
desc = LibDescriptor()
|
desc = LibDescriptor()
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if os.path.splitext(arg)[1] == conf.OBJ_SUFFIX:
|
if os.path.splitext(arg)[1] in [conf.OBJ_SUFFIX, '.i_o']:
|
||||||
desc['OBJS'].append(os.path.abspath(arg))
|
desc['OBJS'].append(os.path.abspath(arg))
|
||||||
elif os.path.splitext(arg)[1] == conf.LIB_SUFFIX and \
|
elif os.path.splitext(arg)[1] == conf.LIB_SUFFIX and \
|
||||||
(os.path.exists(arg) or os.path.exists(arg + conf.LIBS_DESC_SUFFIX)):
|
(os.path.exists(arg) or os.path.exists(arg + conf.LIBS_DESC_SUFFIX)):
|
||||||
|
@ -421,7 +421,7 @@ endif
|
|||||||
ALL_TRASH = \
|
ALL_TRASH = \
|
||||||
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
||||||
$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
|
$(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \
|
||||||
$(OBJS:.$(OBJ_SUFFIX)=.i) \
|
$(OBJS:.$(OBJ_SUFFIX)=.i) $(OBJS:.$(OBJ_SUFFIX)=.i_o) \
|
||||||
$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
|
$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
|
||||||
$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
|
$(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \
|
||||||
$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
|
$(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \
|
||||||
@ -948,6 +948,15 @@ ifdef GNU_CC
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
|
||||||
|
ifdef GNU_CC
|
||||||
|
# Force rebuilding libraries and programs in both passes because each
|
||||||
|
# pass uses different object files.
|
||||||
|
$(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
endif # NO_PROFILE_GUIDED_OPTIMIZE
|
endif # NO_PROFILE_GUIDED_OPTIMIZE
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
|
Loading…
Reference in New Issue
Block a user