@@ -123,25 +123,24 @@ copy_originals: stage2
123
123
124
124
# I don't think there's any particular reason to have -no-huge-pages here, perhaps slightly more accurate profile data
125
125
# as the final build uses -no-huge-pages
126
+ # We reset the mtime of the files to prevent make from rebuilding targets depending on them.
126
127
bolt_instrument : copy_originals
127
128
for file in $( FILES_TO_OPTIMIZE) ; do \
128
129
abs_file=$(STAGE2_BUILD ) /usr/lib/$$ file; \
130
+ old_time=$$(stat -c %Y $$abs_file ) ; \
129
131
$(LLVM_BOLT ) " $$ abs_file.original" -o $$ abs_file --instrument --instrumentation-file-append-pid --instrumentation-file=" $( BOLT_PROFILE_DIR) /$$ file-prof" -no-huge-pages; \
130
132
mkdir -p $$(dirname "$(BOLT_PROFILE_DIR ) /$$file-prof" ) ; \
133
+ touch -d " @$$ old_time" $$ abs_file; \
131
134
printf " \n" ; \
132
135
done && \
133
136
touch $@
134
137
@echo $(AFTER_INSTRUMENT_MESSAGE )
135
138
136
- # We don't want to rebuild julia-src as then we lose the bolt instrumentation
137
- # So we have to manually build the sysimage and package image
138
139
finish_stage2 : PGO_CFLAGS:=-fprofile-use=$(PGO_PROFILE_FILE )
139
140
finish_stage2 : PGO_CXXFLAGS:=-fprofile-use=$(PGO_PROFILE_FILE )
140
141
finish_stage2 : PGO_LDFLAGS:=-flto=thin -fprofile-use=$(PGO_PROFILE_FILE ) -Wl,--icf=safe
141
142
finish_stage2 : stage2
142
- $(MAKE ) -C $(STAGE2_BUILD ) $(TOOLCHAIN_FLAGS ) julia-base-cache && \
143
- $(MAKE ) -C $(STAGE2_BUILD ) $(TOOLCHAIN_FLAGS ) -f sysimage.mk sysimg-release && \
144
- $(MAKE ) -C $(STAGE2_BUILD ) $(TOOLCHAIN_FLAGS ) -f pkgimage.mk release
143
+ $(MAKE ) -C $(STAGE2_BUILD ) $(TOOLCHAIN_FLAGS )
145
144
146
145
merge_data : bolt_instrument
147
146
for file in $( FILES_TO_OPTIMIZE) ; do \
@@ -155,10 +154,13 @@ merge_data: bolt_instrument
155
154
# It tries to reuse old text segments to reduce binary size
156
155
# BOLT doesn't fully support computed gotos https://github.com/llvm/llvm-project/issues/89117, so we cannot use --use-old-text on libjulia-internal
157
156
# That flag saves less than 1 MiB for libjulia-internal so oh well.
157
+ # We reset the mtime of the files to prevent make from rebuilding targets depending on them.
158
158
bolt : merge_data
159
159
for file in $( FILES_TO_OPTIMIZE) ; do \
160
160
abs_file =$(STAGE2_BUILD ) /usr/lib/$$file; \
161
+ old_time=$$(stat -c %Y $$abs_file ) ; \
161
162
$(LLVM_BOLT ) "$$abs_file.original" -data "$(BOLT_PROFILE_DIR ) /$$file-prof.merged.fdata" -o $$abs_file $(BOLT_ARGS ) $$(if [ "$$file" != $(shell readlink $(STAGE2_BUILD ) /usr/lib/libjulia-internal.so) ]; then echo "--use-old-text -split-strategy=cdsplit"; fi) ; \
163
+ touch -d "@$$old_time" $$abs_file; \
162
164
done && \
163
165
touch $@
164
166
0 commit comments