{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/2619","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/2619/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/2619/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/2619/events","html_url":"https://github.com/kripken/emscripten/issues/2619","id":39366833,"number":2619,"title":"Linker eating functions in JSMESS again","user":{"login":"DopefishJustin","id":747261,"avatar_url":"https://avatars.githubusercontent.com/u/747261?v=3","gravatar_id":"","url":"https://api.github.com/users/DopefishJustin","html_url":"https://github.com/DopefishJustin","followers_url":"https://api.github.com/users/DopefishJustin/followers","following_url":"https://api.github.com/users/DopefishJustin/following{/other_user}","gists_url":"https://api.github.com/users/DopefishJustin/gists{/gist_id}","starred_url":"https://api.github.com/users/DopefishJustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DopefishJustin/subscriptions","organizations_url":"https://api.github.com/users/DopefishJustin/orgs","repos_url":"https://api.github.com/users/DopefishJustin/repos","events_url":"https://api.github.com/users/DopefishJustin/events{/privacy}","received_events_url":"https://api.github.com/users/DopefishJustin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":43,"created_at":"2014-08-03T09:23:27Z","updated_at":"2015-01-30T22:39:36Z","closed_at":"2014-12-09T00:00:22Z","body":"Compare https://github.com/kripken/emscripten/issues/131#issuecomment-7089116\r\n\r\nGetting a bunch of warnings about unresolved symbols when compiling JSMESS for the Tandy 1000 with current Emscripten incoming:\r\n\r\n```\r\n/0/home/dfjustin/jsmess/third_party/emscripten/emcc  -O3 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=0 -s COMPILER_ASSERTIONS=1 -s FORCE_ALIGNED_MEMORY=1 -s TOTAL_MEMORY=67108864       -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\"]' -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', 'SDL_PauseAudio']\" -g2 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s DEMANGLE_SUPPORT=1 /0/home/dfjustin/jsmess/third_party/mame/messtandy1t.bc -o /0/home/dfjustin/jsmess/build/tandy1t/messtandy1t.js --pre-js /0/home/dfjustin/jsmess/build/tandy1t/pre.js --post-js /0/home/dfjustin/jsmess/templates/default/post.js\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data7Ei\r\nwarning: unresolved symbol: pthread_attr_setdetachstate\r\nwarning: unresolved symbol: _ZN17centronics_device12write_autofdEi\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data4Ei\r\nwarning: unresolved symbol: _ZN17centronics_device10write_initEi\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data6Ei\r\nwarning: unresolved symbol: _ZN17centronics_device15write_select_inEi\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data1Ei\r\nwarning: unresolved symbol: SDL_UnlockYUVOverlay\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data3Ei\r\nwarning: unresolved symbol: SDL_CreateYUVOverlay\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data0Ei\r\nwarning: unresolved symbol: _ZN17centronics_device12write_strobeEi\r\nwarning: unresolved symbol: pthread_create\r\nwarning: unresolved symbol: SDL_GL_LoadLibrary\r\nwarning: unresolved symbol: SDL_LockYUVOverlay\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data5Ei\r\nwarning: unresolved symbol: SDL_DisplayYUVOverlay\r\nwarning: unresolved symbol: SDL_FreeYUVOverlay\r\nwarning: unresolved symbol: _ZN17centronics_device11write_data2Ei\r\nwarning: unresolved symbol: CENTRONICS\r\nwarning: unresolved symbol: CENTRONICS_COVOX\r\nwarning: unresolved symbol: CENTRONICS_COVOX_STEREO\r\nwarning: unresolved symbol: CENTRONICS_PRINTER\r\nwarning: unresolved symbol: _ZTI17centronics_device\r\n```\r\n\r\nThe pthread and SDL stuff is expected but the centronics functions seem to be getting munched by the linker - they are compiled into libbus.a but not the final binary.\r\n\r\nTo reproduce, use the following files: http://interbutt.com/temp/tandylinkerbug.zip\r\n\r\n```\r\n$ llvm-nm libbus.a | grep _ZN17centronics_device11write_data7Ei\r\n         T _ZN17centronics_device11write_data7Ei\r\n$ emcc -s version.o mess.o drivlist.o tandy1t.o genpc.o pc_t1t.o libosd.a libbus.a liboptional.a libemu.a libdasm.a libutil.a libexpat.a libsoftfloat.a libjpeg.a libflac.a lib7z.a libformats.a liblua.a libsqlite3.a libweb.a libz.a libocore.a libportmidi.a -o messtandy1t\r\n$ llvm-nm messtandy1t | grep _ZN17centronics_device11write_data7Ei\r\n         U _ZN17centronics_device11write_data7Ei\r\n```"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/72283036","html_url":"https://github.com/kripken/emscripten/issues/2619#issuecomment-72283036","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/2619","id":72283036,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T22:39:36Z","updated_at":"2015-01-30T22:39:36Z","body":"I can't find a workaround here. Deleting entries from a `.a` does not let us read them all out one by one, even slowly. And there does not seem to be a good standalone ar handler.\r\n\r\nI pushed a test to verify that we issue a proper warning on this. As the workaround is fairly simple once the problem is known - rename a few source files, as mentioned in the warning text - I think that's the best we can do here."}}