Do not allow removing memcpy function by the opt passes;
Some later code transformation may generate memcpys.
@@ -678,7 +678,8 @@ def optimizeBytecode(inFile, fileNamePrefix):
extra_opts = options.extra_llvm_opts.split(',')
optSwitches += ' -' + ' -'.join(extra_opts)
- internalize_api_list = " -internalize-public-api-list=_start,_pthread_start"
+ internalize_api_list = " -internalize-public-api-list=" \
+ "_start,_pthread_start,memcpy"
if options.keep_symbols != "":
internalize_api_list += "," + options.keep_symbols
@@ -736,7 +737,7 @@ def linkEmulationFuncs(inFile, fileNamePrefix):
outputName = fileNamePrefix + "_emul_internalized.bc"
- internalize_api_list = " -internalize-public-api-list=_start"
+ internalize_api_list = " -internalize-public-api-list=_start,memcpy"
if options.keep_symbols != "":
internalize_api_list += "," + options.keep_symbols
