Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm-ld: error: archive has no index; run ranlib to add one #9329

Closed
Beuc opened this issue Aug 27, 2019 · 5 comments
Closed

wasm-ld: error: archive has no index; run ranlib to add one #9329

Beuc opened this issue Aug 27, 2019 · 5 comments

Comments

@Beuc
Copy link
Contributor

Beuc commented Aug 27, 2019

Hi,

I'm getting these with tot-upstream while compiling ffmpeg (script)

make: ['make']
LD	libswresample/libswresample.so.2
emcc:WARNING: ignoring unsupported linker flag: `-soname`
emcc:WARNING: ignoring unsupported linker flag: `libswresample.so.2`
emcc:WARNING: ignoring unsupported linker flag: `-z`
emcc:WARNING: ignoring unsupported linker flag: `noexecstack`
wasm-ld: error: libavutil/libavutil.a: archive has no index; run ranlib to add one
wasm-ld: error: libavutil/libavutil.a: archive has no index; run ranlib to add one
shared:ERROR: '/home/me/workdir/emtests/renpyweb-asyncify/emsdk/upstream/bin/wasm-ld -o libswresample/libswresample.so.2 --allow-undefined --import-memory --import-table --lto-O0 libswresample/audioconvert.o libswresample/dither.o libswresample/log2_tab.o libswresample/options.o libswresample/rematrix.o libswresample/resample.o libswresample/resample_dsp.o libswresample/swresample.o libswresample/swresample_frame.o libavutil/libavutil.a libavutil/libavutil.a -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export main --export malloc --export free --export setThrew --export __errno_location --export fflush -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024 --relocatable' failed (1)

This breaks the build process, and this didn't happen with 'fastcomp'.

(I see this error referenced in #8995 but it looks like that bug was about something else, hence the separate bug.)

@sbc100
Copy link
Collaborator

sbc100 commented Aug 27, 2019

Its because emar (or llvm-ar) was not used to create the archive. Your system ar does't know about wasm object files so can't create the index.

Setting AR=emar in the same way that you might set CC=emcc is the correct solution.

Feel free to reopen if that doesn't work for you.

@sbc100 sbc100 closed this as completed Aug 27, 2019
@jakogut
Copy link
Contributor

jakogut commented Aug 27, 2019

Another option is to configure with --ar=emar.

@Beuc
Copy link
Contributor Author

Beuc commented Aug 27, 2019

Thanks for the info, indeed ffmpeg doesn't honor the AR environment variable (emconfigure).
Specifying emranlib was also needed.

@sbc100 note that I can't reopen bugs unless I was the one closing them AFAIU!

@kripken
Copy link
Member

kripken commented Aug 27, 2019

note that I can't reopen bugs unless I was the one closing them AFAIU!

Sorry, yeah, I'm not sure why github is like that. But if you ask in a comment to reopen an issue we'll reopen it!

@sbc100
Copy link
Collaborator

sbc100 commented Aug 27, 2019

Ha, I had no idea github worked like that either! Maybe its a setting we have? I will be more conservative in closing issues from now on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants