Hi,

I have been attempting to build ffmpeg under ptxdist - which I appreciate is 
marked as broken but thought I'd have a go anyway.

I managed to build specific version called up by ptxdist (ffmpeg-r12314) 
however that is too old to suite my purposes so I am using a slightly newer 
version (from 2011 era). This all sails through quite nicely until the final 
link point at which it bails out with several hundred unresolved linker errors:

i686-atom-linux-gnu-gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat 
-Llibavutil -Llibpostproc -Llibswscale 
-L/home/jon/projects/ptxdist/platform-i586/sysroot-target/usr/lib 
-Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link,libpostproc 
-Wl,-rpath-link,libswscale -Wl,-rpath-link,libavfilter 
-Wl,-rpath-link,libavdevice -Wl,-rpath-link,libavformat 
-Wl,-rpath-link,libavcodec -Wl,-rpath-link,libavutil -o ffmpeg_g ffmpeg.o 
cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lswscale -lavutil 
-L/home/jon/projects/ptxdist/platform-i586/sysroot-target/usr/lib -lSDL 
-lpthread -lm -pthread -lz -lm
ffmpeg.o: In function `ffmpeg_exit':
ffmpeg.c:(.text+0x673): undefined reference to `avio_close'
ffmpeg.c:(.text+0x67b): undefined reference to `avformat_free_context'
ffmpeg.o: In function `choose_pixel_fmt.isra.3':
...

Looking closely at the linker command line, I can't actually see anything wrong 
here and indeed the symbols it is after are definitely in the "av" libraries 
called up. In fact if you invoke this command outside the ptxdist build 
environment in the relevant build folder (ie. 
platform-i586/build-target/ffmpeg-0.8) then it works perfectly and creates a 
working executable.

So it's something inside the ptxdist environment that is causing this. Delving 
further, I dumped out the environment variables, wrapped it into a script and 
called it thus:

#!/bin/bash
# env.sh
export PTXCONF_SETUP_KERNELMIRROR=http://www.kernel.org/pub/linux
export PTXCONF_SETUP_ENV_WHITELIST=
export PTXDIST_LIB_DIR=/usr/local/lib/ptxdist-2012.12.1/scripts/lib
export 
PTXDIST_PATH_PLATFORMS_XLBSP=/home/jon/projects/ptxdist/platforms/xlbsp:/home/jon/projects/ptxdist/configs/i586-qemu/platforms/xlbsp:/usr/local/lib/ptxdist-2012.12.1/platforms/xlbsp:
...
i686-atom-linux-gnu-gcc -Llibavcodec/ -Llibavdevice -Llibavfilter -Llibavformat 
-Llibavutil ...

then runs as:

env -i ./env.sh

sure enough, it bails with the same linker errors. Stripping back the 
environment variables one by one the thing that seems to upset it is this:

export 
PTXDIST_CROSS_LDFLAGS="-L/home/jon/projects/ptxdist/platform-i586/sysroot-target/lib
 -L/home/jon/projects/ptxdist/platform-i586/sysroot-target/usr/lib 
-Wl,-rpath-link -Wl,/home/jon/projects/ptxdist/platform-i586/sysroot-target/lib 
-Wl,-rpath-link 
-Wl,/home/jon/projects/ptxdist/platform-i586/sysroot-target/usr/lib"

Here is where I'm stumped because this implies to me that the toolchain itself 
has been built to recognize this (ptxdist specific) environment variable and 
act on it in some way. Can anyone explain this?

This is all using ptxdist-2012.1, targeting x86.

Thanks,


Jon.

--
Jon Bird, CEng MBCS
Software Engineer
Electronic Systems
General Dynamics United Kingdom Ltd.
Castleham Road, St Leonards on Sea, East Sussex, TN38 9NJ

Telephone: +441424798278
Email: [email protected]
Website: www.generaldynamics.uk.com


------------------------------------------------------------------------------

This email and any files attached are intended for the addressee and may 
contain information of a confidential nature. If you are not the intended 
recipient, be aware that this email was sent to you in error and you should not 
disclose, distribute, print, copy or make other use of this email or its 
attachments. Such actions, in fact, may be unlawful. In compliance with the 
various Regulations and Acts, General Dynamics United Kingdom Limited reserves 
the right to monitor (and examine for viruses) all emails and email 
attachments, both inbound and outbound. Email communications and their 
attachments may not be secure or error- or virus-free and the company does not 
accept liability or responsibility for such matters or the consequences 
thereof. General Dynamics United Kingdom Limited, Registered Office: 21 Holborn 
Viaduct, London EC1A 2DY. Registered in England and Wales No: 1911653.


-- 
ptxdist mailing list
[email protected]

Reply via email to