mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: <jon.bird@gd-ms.uk>
To: ptxdist@pengutronix.de
Subject: [ptxdist] ffmpeg build/effect of ptxdist build environment
Date: Tue, 3 Nov 2015 16:43:48 +0000	[thread overview]
Message-ID: <94D4A88F8AC34646A5288D11318F5D5B0D89DCE6@GDUKADH841.uk1.r-org.net> (raw)

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: jon.bird@gd-ms.uk
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
ptxdist@pengutronix.de

                 reply	other threads:[~2015-11-03 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94D4A88F8AC34646A5288D11318F5D5B0D89DCE6@GDUKADH841.uk1.r-org.net \
    --to=jon.bird@gd-ms.uk \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox