Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion embuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def main():
library.erase()
if do_build:
if USE_NINJA:
library.generate()
library.generate(deterministic_paths=True)
else:
library.build(deterministic_paths=True)
elif what == 'sysroot':
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
170928
170950
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
142143
142154
Original file line number Diff line number Diff line change
@@ -1 +1 @@
144730
144741
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
232437
232468
13 changes: 8 additions & 5 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ def build(self, deterministic_paths=False):
self.deterministic_paths = deterministic_paths
return cache.get(self.get_path(), self.do_build, force=USE_NINJA == 2, quiet=USE_NINJA)

def generate(self):
self.deterministic_paths = False
def generate(self, deterministic_paths=False):
self.deterministic_paths = deterministic_paths
return cache.get(self.get_path(), self.do_generate, force=USE_NINJA == 2, quiet=USE_NINJA,
deferred=True)

Expand Down Expand Up @@ -600,12 +600,15 @@ def get_cflags(self):
if self.includes:
cflags += ['-I' + utils.path_from_root(i) for i in self._inherit_list('includes')]

source_dir = utils.path_from_root()
relative_source_dir = os.path.relpath(source_dir, self.build_dir)
if self.deterministic_paths:
source_dir = utils.path_from_root()
relative_source_dir = os.path.relpath(source_dir, self.build_dir)
cflags += [f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}']
cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}',
f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}',
f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}']
Comment on lines 606 to 608
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if deterministic_paths part hasn't changed; I only merged two cflags += ... into one and changed the order of the flags.

else:
cflags += [f'-fmacro-prefix-map={source_dir}={DETERMINISITIC_PREFIX}',
f'-fmacro-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}']
return cflags

def get_base_name_prefix(self):
Expand Down
Loading