-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
A lot if not all targets fail to build with '-Wl,--as-needed', without they build fine:
$ x86_64-pc-linux-gnu-gcc -march=corei7-avx -O2 -pipe -I/usr/include/mjpegtools -I/usr/include/freetype2 -D__STDC_CONSTANT_MACROS -c -o libav-bitrate.o libav-bitrate.c
$ x86_64-pc-linux-gnu-gcc -march=corei7-avx -O2 -pipe -I/usr/include/mjpegtools -I/usr/include/freetype2 -D__STDC_CONSTANT_MACROS -c -o progress.o progress.c
progress.c: In function ‘progress_loadBar’:
progress.c:129:2: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘off_t’ [-Wformat]
$ x86_64-pc-linux-gnu-gcc -march=corei7-avx -O2 -pipe -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -lswscale -lavcodec -lavformat -lavutil -o libav-bitrate libav-bitrate.o progress.o
libav-bitrate.o: In function `main':
libav-bitrate.c:(.text.startup+0x242): undefined reference to `av_register_all'
libav-bitrate.c:(.text.startup+0x269): undefined reference to `avformat_open_input'
libav-bitrate.c:(.text.startup+0x280): undefined reference to `avformat_find_stream_info'
libav-bitrate.c:(.text.startup+0x29d): undefined reference to `av_dump_format'
libav-bitrate.c:(.text.startup+0x3aa): undefined reference to `avcodec_find_decoder'
libav-bitrate.c:(.text.startup+0x412): undefined reference to `avcodec_open2'
libav-bitrate.c:(.text.startup+0x41f): undefined reference to `avcodec_alloc_frame'
libav-bitrate.c:(.text.startup+0x4b3): undefined reference to `av_free_packet'
libav-bitrate.c:(.text.startup+0x4c8): undefined reference to `av_read_frame'
libav-bitrate.c:(.text.startup+0x55b): undefined reference to `avcodec_decode_video2'
libav-bitrate.c:(.text.startup+0x70e): undefined reference to `av_free'
libav-bitrate.c:(.text.startup+0x718): undefined reference to `avcodec_close'
libav-bitrate.c:(.text.startup+0x725): undefined reference to `avformat_close_input'
collect2: error: ld returned 1 exit status
$ x86_64-pc-linux-gnu-gcc -march=corei7-avx -O2 -pipe -Wl,--hash-style=gnu -Wl,-O1 -lswscale -lavcodec -lavformat -lavutil -o libav-bitrate libav-bitrate.o progress.o
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels