Skip to content

Commit

Permalink
Merge branch 'main' into libunwind_changelog_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aheejin committed Dec 20, 2024
2 parents 5ee5731 + 74d95fb commit 6475078
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/fs/test_fs_enotdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {
assert(errno == ENOTDIR);
}
{
assert(open("./does-not-exist/", O_CREAT) == -1);
assert(open("./does-not-exist/", O_CREAT, 0777) == -1);
assert(errno == EISDIR);
}
printf("success\n");
Expand Down
1 change: 1 addition & 0 deletions test/fs/test_fs_readdir_ino_matches_stat_ino.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ int main() {
assert(a_ino == sta.st_ino);
assert(b_ino == stb.st_ino);
printf("success\n");
closedir(dirp);
return 0;
}
6 changes: 3 additions & 3 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from tools.shared import PIPE
from tools.shared import EMCC, EMAR, FILE_PACKAGER
from tools.utils import WINDOWS, MACOS, write_file, delete_file
from tools.utils import WINDOWS, MACOS, LINUX, write_file, delete_file
from tools import shared, building, config, utils, webassembly
import common
from common import RunnerCore, path_from_root, requires_native_clang, test_file, create_file
Expand Down Expand Up @@ -5546,8 +5546,8 @@ def test_fcntl(self):
@also_with_nodefs_both
@crossplatform
def test_fcntl_open(self):
if '-DNODERAWFS' in self.emcc_args and WINDOWS:
self.skipTest('currently failing under windows and noderawfs')
if '-DNODERAWFS' in self.emcc_args and not LINUX:
self.skipTest('noderawfs fails here under non-linux')
self.do_run_in_out_file_test('fcntl/test_fcntl_open.c')

@also_with_wasm_bigint
Expand Down
21 changes: 8 additions & 13 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,9 @@ def get_files(self):
def generate_ninja(self, build_dir, libname):
ensure_sysroot()
utils.safe_ensure_dirs(build_dir)
self.build_dir = build_dir

cflags = self.get_cflags()
if self.deterministic_paths:
source_dir = utils.path_from_root()
relative_source_dir = os.path.relpath(source_dir, build_dir)
cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}',
f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}',
f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}']
asflags = get_base_cflags(preprocess=False)
input_files = self.get_files()
ninja_file = os.path.join(build_dir, 'build.ninja')
Expand All @@ -492,17 +487,11 @@ def build_objects(self, build_dir):
with the `cflags` returned by `self.get_cflags()`.
"""
batch_inputs = int(os.environ.get('EMCC_BATCH_BUILD', '1'))
self.build_dir = build_dir
batches = {}
commands = []
objects = set()
cflags = self.get_cflags()
if self.deterministic_paths:
source_dir = utils.path_from_root()
if batch_inputs:
relative_source_dir = os.path.relpath(source_dir, build_dir)
cflags += [f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}']
cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}',
f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}']
case_insensitive = is_case_insensitive(build_dir)
for src in self.get_files():
ext = shared.suffix(src)
Expand Down Expand Up @@ -611,6 +600,12 @@ def get_cflags(self):
if self.includes:
cflags += ['-I' + utils.path_from_root(i) for i in self._inherit_list('includes')]

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'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}']
return cflags

def get_base_name_prefix(self):
Expand Down

0 comments on commit 6475078

Please sign in to comment.