Skip to content

Commit 922608f

Browse files
committed
build libcxx and libcxxabi using direct commands, not a makefile, to make this more easily portable to windows where make is not always present
1 parent 146bd5f commit 922608f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

emcc

+14-4
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,13 @@ try:
846846
# libcxx
847847
def create_libcxx():
848848
if DEBUG: print >> sys.stderr, 'emcc: building libcxx for cache'
849-
shared.Building.build_library('libcxx', shared.EMSCRIPTEN_TEMP_DIR, shared.EMSCRIPTEN_TEMP_DIR, ['libcxx.bc'], configure=None, copy_project=True, source_dir=shared.path_from_root('system', 'lib', 'libcxx'))
850-
return os.path.join(shared.EMSCRIPTEN_TEMP_DIR, 'libcxx', 'libcxx.bc')
849+
os = []
850+
for src in ['algorithm.cpp', 'condition_variable.cpp', 'future.cpp', 'iostream.cpp', 'memory.cpp', 'random.cpp', 'stdexcept.cpp', 'system_error.cpp', 'utility.cpp', 'bind.cpp', 'debug.cpp', 'hash.cpp', 'mutex.cpp', 'string.cpp', 'thread.cpp', 'valarray.cpp', 'chrono.cpp', 'exception.cpp', 'ios.cpp', 'locale.cpp', 'regex.cpp', 'strstream.cpp', 'typeinfo.cpp']:
851+
o = in_temp(src + '.o')
852+
execute(shared.ENV_PREFIX + ['python', shared.EMXX, shared.path_from_root('system', 'lib', 'libcxx', src), '-o', o], stdout=stdout, stderr=stderr)
853+
os.append(o)
854+
shared.Building.link(os, in_temp('libcxx.bc'))
855+
return in_temp('libcxx.bc')
851856
def fix_libcxx():
852857
assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++ with QUANTUM_SIZE == 1'
853858
# libcxx might need corrections, so turn them all on. TODO: check which are actually needed
@@ -860,8 +865,13 @@ try:
860865
# libcxxabi - just for dynamic_cast for now
861866
def create_libcxxabi():
862867
if DEBUG: print >> sys.stderr, 'emcc: building libcxxabi for cache'
863-
shared.Building.build_library('libcxxabi', shared.EMSCRIPTEN_TEMP_DIR, shared.EMSCRIPTEN_TEMP_DIR, ['libcxxabi.bc'], configure=None, copy_project=True, source_dir=shared.path_from_root('system', 'lib', 'libcxxabi'))
864-
return os.path.join(shared.EMSCRIPTEN_TEMP_DIR, 'libcxxabi', 'libcxxabi.bc')
868+
os = []
869+
for src in ['private_typeinfo.cpp']:
870+
o = in_temp(src + '.o')
871+
execute(shared.ENV_PREFIX + ['python', shared.EMXX, shared.path_from_root('system', 'lib', 'libcxxabi', 'src', src), '-o', o], stdout=stdout, stderr=stderr)
872+
os.append(o)
873+
shared.Building.link(os, in_temp('libcxxabi.bc'))
874+
return in_temp('libcxxabi.bc')
865875
def fix_libcxxabi():
866876
assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++abi with QUANTUM_SIZE == 1'
867877
#print >> sys.stderr, 'emcc: info: using libcxxabi, this may need CORRECT_* options'

0 commit comments

Comments
 (0)