mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Toolchain: host-m4 build error
Date: Mon, 13 May 2019 22:16:25 +0200	[thread overview]
Message-ID: <20190513201625.pwl5ua6kfpkkqax7@pengutronix.de> (raw)
In-Reply-To: <20190513195956.GA2285@archibald.tuxnet>

On Mon, May 13, 2019 at 09:59:56PM +0200, Clemens Gruber wrote:
> On Mon, May 13, 2019 at 08:57:47PM +0200, Michael Olbrich wrote:
> > On Mon, May 13, 2019 at 03:49:18PM +0200, Clemens Gruber wrote:
> > > On Mon, May 13, 2019 at 07:48:59AM +0200, Michael Olbrich wrote:
> > > > On Mon, May 13, 2019 at 12:43:59AM +0200, Clemens Gruber wrote:
> > > > > when building a toolchain based on OSELAS.Toolchain-2018.02.x, I get the
> > > > > following error at the end of the host-m4 build, in the install.pack
> > > > > stage:
> > > > > 
> > > > > new rpath '${ORIGIN}/../lib' too large; maximum length 4
> > > > > 
> > > > > ptxdist: error: Failed to adjust rpath for '~/toolchain/platform-../packages/host-m4-1.4.18/bin/m4'
> > > > > 
> > > > > --
> > > > > 
> > > > > readelf tells me:
> > > > > ...
> > > > > 0x000000000000000f (RPATH)              Library rpath: [/lib]
> > > > > ...
> > > > > 
> > > > > So there is not enough space to put in ${ORIGIN}/../lib
> > > > > 
> > > > > --
> > > > > 
> > > > > Any idea why this is only happening in the toolchain build and how to
> > > > > fix it?
> > > > > 
> > > > > Host OS: ArchLinux
> > > > > Host GCC: 8.3.0
> > > > > PTXdist: 2019.05.0
> > > > 
> > > > I've heard of this error, but I've never seen it myself.
> > > > Can you do the following:
> > > > $ ptxdist clean host-m4
> > > > Then move / remove platform-.../logfile
> > > > $ ptxdist -v install host-m4
> > > > And then send the logfile.
> > > > 
> > > > The gcc wrapper should be used when host-m4 is compiled. And it should add
> > > > a longer rpath. With '-v' the wrapper will write the full commandline, so
> > > > we can see where the rpath is lost.
> > > 
> > > I am sending the logfile attached to this message.
> > [...]
> > > gcc   -g -O2   -o m4 m4.o builtin.o debug.o eval.o format.o freeze.o input.o macro.o output.o path.o symtab.o ../lib/libm4.a  /lib/libsigsegv.so -Wl,-rpath -Wl,/lib  
> > > wrapper:  gcc  -Wl,--as-needed -isystem /home/clemens/Dev/gruberzr-toolchain/platform-arm-v7a-linux-gnueabihf-gcc-8.2.1-glibc-2.28-binutils-2.31.1-kernel-4.19-sanitized/sysroot-host/include   -g -O2 -o m4 m4.o builtin.o debug.o eval.o format.o freeze.o input.o macro.o output.o path.o symtab.o ../lib/libm4.a /lib/libsigsegv.so -Wl,-rpath -Wl,/lib  -L/home/clemens/Dev/gruberzr-toolchain/platform-arm-v7a-linux-gnueabihf-gcc-8.2.1-glibc-2.28-binutils-2.31.1-kernel-4.19-sanitized/sysroot-host/lib
> > [...]
> > 
> > Right, I see the problem. The toolchain overwrites PTXDIST_HOST_LDFLAGS to
> > _not_ add the rpath. This is correct because the toolchain avoids any extra
> > shared libraries. And when this was implemented, this was done to avoid
> > leaking any absolute paths into the toolchain binaries.
> > 
> > This works in most cases, because the end result is no rpath at all. And
> > PTXdist will skip calling chrpath.
> > For some reason, the m4 build system adds the '-Wl,-rpath -Wl,/lib' so
> > there is a rpath. PTXdist tries to change it an fails.
> > 
> > Try adding configure options for host-m4 that include --disable-rpath.
> > Does that help?
> > 
> > I'm currently testing a patch for ptxdist upstream that does this. It
> > should be in master some time this week.
> 
> Great, thanks! This fixes the m4 problem.
> 
> A few packages later, another problem popped up though. Probably not
> related:
> 
> (...)
> --------------------------------------------
> target: host-autotools-automake.install.post
> --------------------------------------------
> 
> sed: can't read .../toolchain/platform-../packages/host-automake-1.16.1/bin/*: No such file or directory
> sed: can't read .../toolchain/platform-../packages/host-automake-1.16.1/share/automake-*/Automake/Config.pm: No such file or directory
> make: *** [/usr/local/lib/ptxdist-2019.05.0/rules/host-autotools-automake.make:48: .../toolchain/platform-../state/host-autotools-automake.install.post] Error 2
> 
> --
> 
> I worked around it by removing the custom install stage from
> host-autotools-auto(make|conf).make after copying them into the
> toolchain rules directory.
> 
> Something else:
> According to the selected_ptxconfig, HOST_AUTOTOOLS_AUTOMAKE is not
> selected. Is this host dependency pulled in automatically without a
> PTXCONF_HOST_AUTOTOOLS_AUTOMAKE=y in the ptxconfig file?

That's because you're using a different ptxdist version. Run 'oldconfig'
und PTXCONF_HOST_AUTOTOOLS_AUTOMAKE=y should show up in the ptxconfig file.
And then the missing files should be there, because the package is actually
built.

In general you should use the PTXdist version specified in the config file
anything else may break in arbitrary ways.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2019-05-13 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-12 22:43 Clemens Gruber
2019-05-13  5:48 ` Michael Olbrich
2019-05-13 13:49   ` Clemens Gruber
2019-05-13 18:57     ` Michael Olbrich
2019-05-13 19:59       ` Clemens Gruber
2019-05-13 20:16         ` Michael Olbrich [this message]

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=20190513201625.pwl5ua6kfpkkqax7@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --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