Re: [ptxdist] Toolchain: host-m4 build error

2019-05-13 Thread Michael Olbrich
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:
> > > > > ...
> > > > > 0x000f (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 

Re: [ptxdist] Toolchain: host-m4 build error

2019-05-13 Thread Clemens Gruber
Hi,

On Mon, May 13, 2019 at 08:57:47PM +0200, Michael Olbrich wrote:
> Hi,
> 
> 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:
> > > > ...
> > > > 0x000f (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?

Thanks,
Clemens

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] Toolchain: host-m4 build error

2019-05-13 Thread Michael Olbrich
Hi,

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:
> > > ...
> > > 0x000f (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.

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- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] Toolchain: host-m4 build error

2019-05-12 Thread Michael Olbrich
Hi,

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:
> ...
> 0x000f (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.

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- |

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] Toolchain: host-m4 build error

2019-05-12 Thread Clemens Gruber
Hi,

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:
...
0x000f (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

Thanks and best regards,
Clemens

___
ptxdist mailing list
ptxdist@pengutronix.de