Skip to content

error: undefined symbol: htons / ntohs / rand due to deps_info.json not seeing files from .a's #9566

Closed

Description

@Beuc

Hi,

In the final link of my RenPyWeb project and its ~10 dependencies, since upgrading 1.38.46 I now get:

$ emcc ... *.o ... -o index.html
error: undefined symbol: htons
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: ntohs
error: undefined symbol: rand
Error: Aborting compilation due to previous errors

This reminds me of #9154 though that one remains fixed.

Let me know how I can further diagnose the issue.

EDIT: reported by compiler.js:

shared:ERROR: '.../emsdk/node/12.9.1_64bit/bin/node .../emsdk/upstream/emscripten-git/src/compiler.js /tmp/tmpcnboo9.txt .../emsdk/upstream/emscripten-git/src/library_pthread_stub.js' failed (1)

Activity

  1. Beuc commented on Oct 2, 2019

    @Beuc
    ContributorAuthor

    In addition, passing -s ERROR_ON_UNDEFINED_SYMBOLS=0 triggers ReferenceError: __get_timezone is not defined at runtime (not sure it's related).

  2. kripken commented on Oct 2, 2019

    @kripken
    Member

    If it's hard to reduce this, if you can provide the final emcc link command + input files, that should be enough for us to debug it.

  3. Beuc commented on Oct 2, 2019

    @Beuc
    ContributorAuthor

    Here's another simpler one (Python web prompt) which seems related:

    + emcc -o t/webprompt.html webprompt-main.c t/emscripten.c -I/home/me/workdir/emtests/renpyweb-asyncify/python-emscripten/2.7.10/destdir/include/python2.7 -L/home/me/workdir/emtests/renpyweb-asyncify/python-emscripten/2.7.10/destdir/lib -lpython2.7 -s EMULATE_FUNCTION_POINTER_CASTS=1 -s USE_ZLIB=1 -s TOTAL_MEMORY=256MB --preload-file /home/me/workdir/emtests/renpyweb-asyncify/python-emscripten/2.7.10/destdir/lib/python2.7@/lib/python2.7 --shell-file webprompt-shell.html -s 'EXPORTED_FUNCTIONS=['\''_main'\'', '\''_malloc'\'', '\''_Py_Initialize'\'', '\''_PyRun_SimpleString'\'']' -s 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'
    wasm-ld: error: /home/me/workdir/emtests/renpyweb-asyncify/python-emscripten/2.7.10/destdir/lib/libpython2.7.a(posixmodule.o): undefined symbol: environ
    

    Do you want a tar archive?

  4. kripken commented on Oct 2, 2019

    @kripken
    Member

    Sure, a tar is ok.

  5. Beuc commented on Oct 2, 2019

    @Beuc
    ContributorAuthor

    There it is (lighter than my full ~2GB RenPyWeb build environment...)

    emcc -o t/webprompt.html webprompt-main.c t/emscripten.c -Ipython2.7 -L. -lpython2.7 -s EMULATE_FUNCTION_POINTER_CASTS=1 -s USE_ZLIB=1 -s TOTAL_MEMORY=256MB -s 'EXPORTED_FUNCTIONS=['\''_main'\'', '\''_malloc'\'', '\''_Py_Initialize'\'', '\''_PyRun_SimpleString'\'']' -s 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]'
    

    https://www.beuc.net/tmp/link.tgz

    There's a difference though, the OP is reported in compiler.js, this one in wasm-ld.

  6. kripken commented on Oct 2, 2019

    @kripken
    Member

    Thanks!

    Ok, I think I understand the underlying problem. Here is a reduced testcase:

      # in tests/test_other.py
      def test_gethostbyname_in_a(self):
        # handle singleton archives
        run_process([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_gethostbyname.c'), '-o', 'a.o'])
        run_process([LLVM_AR, 'r', 'liba.a', 'a.o'])
        create_test_file('empty.c', 'static int foo = 0;')
        run_process([PYTHON, EMCC, 'empty.c', '-la', '-L.'])
        self.assertContained('success', run_js('a.out.js'))
    

    The issue is that we use deps_info.json to handle linking in C code that JS will need, and we do implement the sockets code in JS, which ends up wanting htons etc. This normally works, but I bisected to #9436, and from that point on we are broken. I didn't look into that PR's code but looking on incoming, the issue is that for deps_info.json purposes we only look at the immediately compiled files... and not files in a library that is linked in. So we fail to see we will need things. My guess is that that PR changed which files get looked at there.

  7. changed the title [-]error: undefined symbol: htons / ntohs / rand[/-] [+]error: undefined symbol: htons / ntohs / rand due to deps_info.json not seeing files from .a's[/+] on Oct 2, 2019
  8. sbc100 commented on Oct 8, 2019

    @sbc100
    Collaborator

    @kripken are you looking into this already? Want me to take a look?

  9. kripken commented on Oct 8, 2019

    @kripken
    Member

    @sbc100 I'm not looking into it, no - was hoping you'd have an idea from the investigation I did + your better understanding of the PR where this broke? Would be great if you can take a look!

  10. simulacrumgames commented on Dec 7, 2021

    @simulacrumgames

    @kripken

    I believe I'm having the same issue in 3.0.0 with Unreal Engine 4.24. I'm attempting to upgrade from emscripten 1.39.0 and get the following output:

    UATHelper: Packaging (HTML5):     warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
    UATHelper: Packaging (HTML5):     warning: _htons may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    UATHelper: Packaging (HTML5):     error: undefined symbol: ntohs (referenced by $inetNtop6__deps: ['$inetNtop4','ntohs'], referenced by $readSockaddr__deps: ['$Sockets','$inetNtop4','$inetNtop6','ntohs'], referenced by $getSocketAddress__deps: ['$readSockaddr','$FS','$DNS'], referenced by __syscall_bind__deps: ['$getSocketFromFD','$getSocketAddress','$SYSCALLS'], referenced by top-level compiled C/C++ code)
    UATHelper: Packaging (HTML5):     warning: _ntohs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    UATHelper: Packaging (HTML5):     error: undefined symbol: _get_daylight (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    UATHelper: Packaging (HTML5):     warning: __get_daylight may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    UATHelper: Packaging (HTML5):     error: undefined symbol: _get_timezone (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    UATHelper: Packaging (HTML5):     warning: __get_timezone may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    UATHelper: Packaging (HTML5):     error: undefined symbol: _get_tzname (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    UATHelper: Packaging (HTML5):     warning: __get_tzname may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    UATHelper: Packaging (HTML5):     Error: Aborting compilation due to previous errors
    UATHelper: Packaging (HTML5):     emcc: error: 'I:/_repos/unreal_html5/Engine/Platforms/HTML5/Build/emsdk/emsdk-3.0.0/node/14.15.5_64bit/bin/node.exe I:\_repos\unreal_html5\Engine\Platforms\HTML5\Build\emsdk\emsdk-3.0.0\upstream\emscripten\src\compiler.js I:\_repos\unreal_html5\Engine\Intermediate\Build\HTML5\EmscriptenTemp\tmpthj1ixne.txt' failed (returned 
    1)
    

    The build is successful if I pass -s ERROR_ON_UNDEFINED_SYMBOLS=0 but I get ReferenceError: __get_timezone is immediately after loading in the browser.

    Here is how UE's "Package Project" calls the linker:

    I:\_repos\unreal_html5\Engine\Platforms\HTML5\Build\emsdk\emsdk-3.0.0\python\3.9.2-1_64bit\python.exe "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Build\emsdk\emsdk-3.0.0\upstream\emscripten\emcc.py" @"I:\_repos\unreal_html5\Engine\Intermediate\Build\HTML5\UE4\Development\UE4Game.js.response"
    

    UE4Game.js.response contains:

    -fdiagnostics-format=msvc -fno-exceptions -Wdelete-non-virtual-dtor -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-tautological-undefined-compare -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-invalid-offsetof -Wno-gnu-string-literal-operator-template -Wno-final-dtor-non-final-class -Wno-implicit-int-float-conversion -O2 -fno-inline-functions -s WASM_OBJECT_FILES=1 --profiling-funcs --emit-symbol-map -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -s GL_DEBUG=1 -s EVAL_CTORS=0 -g1 -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=32MB -s USE_WEBGL2=1 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s GL_PREINITIALIZED_CONTEXT=1 -s WASM=1 -s EXPORTED_FUNCTIONS="['_main', '_on_fatal']" -s EXPORTED_RUNTIME_METHODS="['Pointer_stringify', 'writeAsciiToMemory', 'stackTrace']" -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s NO_EXIT_RUNTIME=1 -s CASE_INSENSITIVE_FS=1 -s FORCE_FILESYSTEM=1
    "*.o"
    --js-library "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\Runtime\HTML5\HTML5JS\Private\HTML5JavaScriptFx.js"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\LowLevel_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\LowLevelAABB_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\LowLevelCloth_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\LowLevelDynamics_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\LowLevelParticles_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3CharacterKinematic_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3Common_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3Extensions_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\SceneQuery_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\SimulationController_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PxFoundation_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PxPvdSDK_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PxTask_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PsFastXml_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3Vehicle_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\FreeType2\FreeType2-2.10.0\lib-3.0.0-up\libfreetype_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\ICU\icu4c-64_1\lib-3.0.0-up\libicu_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\HarfBuzz\harfbuzz-2.4.0\lib-3.0.0-up\libharfbuzz_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\zlib\v1.2.8\lib-3.0.0-up\zlib_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\libPNG\libPNG-1.5.27\lib-3.0.0-up\libpng_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\Ogg\libogg-1.2.2\lib-3.0.0-up\libogg_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\Vorbis\libvorbis-1.3.2\lib-3.0.0-up\libvorbis_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\Vorbis\libvorbis-1.3.2\lib-3.0.0-up\libvorbisfile_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\libOpus\opus-1.1\lib-3.0.0-up\libopus_O2.a"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\libOpus\opus-1.1\lib-3.0.0-up\libspeex_resampler_O2.o"
     "I:\_repos\unreal_html5\Engine\Platforms\HTML5\Source\ThirdParty\PhysX3\PhysX_3.4\lib-3.0.0-up\PhysX3Cooking_O2.a"
     -o "I:\_repos\unreal_html5\Engine\Binaries\HTML5\UE4Game.js"
    

    Where "*.o" is there are about 500 engine/project files. I know UE needs functions like ntohs() and gettimezone(), but is there something else that needs to be done to link properly? I thought such things would get pulled in automatically if a function call like bind() exists somewhere? I can see bind() is called from UE's SocketsBSD.cpp which is being included in the build.

  11. sbc100 commented on Dec 7, 2021

    @sbc100
    Collaborator

    This could be an issue with the parsing of the output of nm and the handling of reverse dependencies.

    You might need to help us out by adding some debugging to tools/system_libs.py in and around the handle_reverse_deps function. If bind is being referenced by any of your input files then ntohs would be pulled in. Perhaps you can figure out why handle_reverse_deps doesn't seem be finding the bind reference?

    @juj might be able to help?

  12. simulacrumgames commented on Dec 8, 2021

    @simulacrumgames

    @sbc100 Thank you for the quick response, I had found other posts suggesting to use -s EMCC_FORCE_STDLIBS=1 but this gave me an error for unknown option, I'm guessing it was removed? However, after looking through src/settings.js I found the following options:

    -s AUTO_JS_LIBRARIES=1
    -s AUTO_NATIVE_LIBRARIES=1
    -s REVERSE_DEPS=all

    Enabling these allowed me to build and load in the browser so I can start working on updating outdated emscripten calls in UE but linking seems to take a really long time now (as compared to 1.39.0). Would you recommend I avoid using some or all of the above options?

    Now, looking at handle_reverse_deps I see that the behavior will have changed significantly by using -s REVERSE_DEPS=all.

    What debugging information would be helpful from handle_reverse_deps? Logging the contents of symbolses = building.llvm_nm_multiple([os.path.abspath(t) for t in input_files]) or something?

  13. sbc100 commented on Dec 8, 2021

    @sbc100
    Collaborator

    -s AUTO_JS_LIBRARIES=1 and -s AUTO_NATIVE_LIBRARIES=1 are both the default so I don't think they are relevant here.

    Using -s REVERSE_DEPS=all is basically saying that all reverse deps should be included and not just the ones that are needed by your program (according the the results of running nm on your inputs).

    You need to find out which of your .a libraryies contains the references the bind C library call... this is the one that appears to not be detected by handle_reverse_deps. I would look at the llvm_nm_multiple function in building.py which is called from handle_reverse_deps. I would log that names of each of the input files.. then when you see the name matches the one you expect to find the reference to bind in, log the results and see why bind is not part of the results.

    You can find out which library has the bind reference either by running llvm-nm on all your libraries or by linking with -Wl,--trace-symbol=bind.

  14. simulacrumgames commented on Dec 9, 2021

    @simulacrumgames

    I got the following output:

    I:\\_repos\\unreal_html5_examples\\CP_TPP\\Intermediate\\Build\\HTML5\\CP_TPPClient\\Development\\Sockets\\Module.Sockets.cpp.o: reference to bind
    I:\\_repos\\unreal_html5\\Engine\\Platforms\\HTML5\\Source\\ThirdParty\\PhysX3\\PhysX_3.4\\lib-3.0.0-up\\PxFoundation_O2.a(PsUnixSocket.cpp.o): reference to bind
    I:\\_repos\\unreal_html5\\Engine\\Platforms\\HTML5\\Build\\emsdk\\emsdk-3.0.0\\upstream\\emscripten\\cache\\sysroot\\lib\\wasm32-emscripten\libsockets.a(bind.o): definition of bind
    error: undefined symbol: htons (referenced by $inetPton6__deps: ['htons','$jstoi_q'], referenced by $writeSockaddr__deps: ['$Sockets','$inetPton4','$inetPton6','$zeroMemory'], referenced by __syscall_accept4__deps: ['$getSocketFromFD','$writeSockaddr','$DNS','$SYSCALLS'], referenced by top-level compiled C/C++ code)
    warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
    warning: _htons may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    error: undefined symbol: ntohs (referenced by $inetNtop6__deps: ['$inetNtop4','ntohs'], referenced by $readSockaddr__deps: ['$Sockets','$inetNtop4','$inetNtop6','ntohs'], referenced by $getSocketAddress__deps: ['$readSockaddr','$FS','$DNS'], referenced by __syscall_bind__deps: ['$getSocketFromFD','$getSocketAddress','$SYSCALLS'], referenced by top-level compiled C/C++ code)
    warning: _ntohs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    error: undefined symbol: _get_daylight (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    warning: __get_daylight may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    error: undefined symbol: _get_timezone (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    warning: __get_timezone may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    error: undefined symbol: _get_tzname (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code)
    warning: __get_tzname may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
    Error: Aborting compilation due to previous errors
    

    For Module.Sockets.cpp.o I can see the following from handle_reverse_deps:

    I:\\_repos\\unreal_html5_examples\\CP_TPP\\Intermediate\\Build\\HTML5\\CP_TPPClient\\Development\\Sockets\\Module.Sockets.cpp.o::
       'defs':{
            ...
            '_ZN10FSocketBSD4BindERK13FInternetAddr',
            ...
       },
       'undefs':{
            ...
          'htons',
            ...
          'bind',
            ...
          'ntohs',
            ...
       },
       'commons':'set()',
       'parse_error':false
    

    Module.Sockets.cpp.o_reverse_deps.txt

    bind
    PxFoundation_O2.a_reverse_deps.txt

    localtime_r
    Module.Core.2_of_11.cpp.o_reverse_deps.txt

    localtime_r
    tzset
    libicu_O2.a_reverse_deps.txt

    I'm not sure if I'm interpreting the output correctly but so far each of the undefs lists the missing function so shouldn't they get picked up automatically since each of these functions appear in deps_info.py?

  15. sbc100 commented on Dec 9, 2021

    @sbc100
    Collaborator

    Indeed. The next step would be to add -v to your link command so it prints out the underlying wasm-ld command.. you should see all the required symbols listed as --export or --export-if-defined, included htons.

    You can also check if htons was correct pulled out of deps_info.py by logging each of the symbols that gets added to EXPORTED_FUNCTIONS in tools/system_libs.py line 1617. If bind is indeed found in your libraries then ntons should be added here.

  16. simulacrumgames commented on Dec 14, 2021

    @simulacrumgames

    It seems this test is never passed in system_libs.py:

        for ident, deps in deps_info.get_deps_info().items():
    >     if ident in need['undefs'] and ident not in added:
    

    I can see bind is checked:

    ident=bind;
    	deps=['ntohs', 'htons'];
    	need['undefs']={'emscripten_stack_get_end', 'stackSave', 'stackRestore', '__cxa_demangle', 'emscripten_stack_init', '__errno_location', '__wasm_call_ctors', 'free', 'fflush', 'malloc', 'stackAlloc', 'emscripten_stack_get_free', 'on_fatal', 'main'};
    	added=set()
    

    But nothing is ever added in this loop.
    Actually I don't see any of the UE functions found in llvm_nm_multiple in this output.

    Before I had printed the output of results.stdout here is what I get if I print out what is parsed:

      for key, value in parse_llvm_nm_symbols(results.stdout).items():
        nm_cache[key] = value
    
      print(f'cmd:{cmd};\n\tresults:{parse_llvm_nm_symbols(results.stdout).items()}')
    
      return [nm_cache[f] if f in nm_cache else {'defs': set(), 'undefs': set(), 'parse_error': True} for f in files]
    
    cmd:['I:/_repos/unreal_html5/Engine/Platforms/HTML5/Build/emsdk/emsdk-3.0.0/upstream/bin\\llvm-nm.exe', '@C:\\Users\\<>\\AppData\\Local\\Temp\\emscripten_t1cthm09.rsp.utf-8'];
    	results:dict_items([('I:\\\\_repos\\\\unreal_html5_examples\\\\CP_TPP\\\\Intermediate\\\\Build\\\\HTML5\\\\CP_TPPClient\\\\Development\\\\Launch\\\\Module.Launch.cpp.o', {'defs': ...
    

    It looks like the return loop isn't iterating over the results correctly because the only input file is emscripten_t1cthm09.rsp.utf-8?

  17. sbc100 commented on Dec 14, 2021

    @sbc100
    Collaborator

    I'm not sure I understand the problem here. Why do you think the use of the rsp (response file) is an issue?

    Perhaps you could try running pprint.print(results.stdout) and pprint.print(nm_cache) and then attaching the resulting (huge) output to this bug? (you will need to import pprint too).

  18. simulacrumgames commented on Dec 17, 2021

    @simulacrumgames

    If I understand correctly, for this line:

      return [nm_cache[f] if f in nm_cache else {'defs': set(), 'undefs': set(), 'parse_error': True} for f in files]
    

    It is only going to return the items in nm_cache that are also listed in files but the only entry is emscripten_t1cthm09.rsp.utf-8 so it ends up adding nothing.

    The files I previously uploaded (*.reverse_deps.txt) were the key and value variables from the loop. nm_cache does contain all the correct data from llvm_nm, it's just that each entry gets filtered out because it doesn't appear in files.

  19. sbc100 commented on Dec 17, 2021

    @sbc100
    Collaborator

    Are you sure files doesn't contain the actual filenames?

    IIUC the emscripten_t1cthm09.rsp.utf-8 is generated by this line: cmd = get_command_with_possible_response_file(cmd)

    Can you confirm that files contains the response file? IIUC it should not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions