Message ID | 20210113052824.444674-1-npiggin@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | build: update instructions for hard-float BMCs | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch master (47687270521b88dddc93bbac451ef5e5e6f22ded) |
snowpatch_ozlabs/build-multiarch | success | Test build-multiarch on branch master |
On Wed, 13 Jan 2021 at 05:28, Nicholas Piggin <npiggin@gmail.com> wrote: > > The previous patch was papering over the issue, badly. The cause of > the problem is that some OpenBMC builds have started to use hard float. > I didn't look hard enough and my ignorance of the ARM environment (and > the fact it "worked") made me think this was a more benign configuration > issue. > > So update the build instructions to select the hard-float toolchain > when necessary. Confirmed this works on Debian. > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Thanks for getting to the bottom of this. > --- > README.md | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/README.md b/README.md > index 7892a8d..e0f4842 100644 > --- a/README.md > +++ b/README.md > @@ -17,6 +17,11 @@ top level directory. Static linking is supported and can be performed by adding > > ### Cross compiling for BMC (ARM) > > +First, work out if your BMC is using the hard or soft float ABI. If the > +file /lib/ld-linux.so.3 exists, soft-float. If /lib/ld-linux-armhf.so.3 > +exists, hard-float. > + > +To build for soft-float: > ``` > apt-get install gcc-arm-linux-gnueabi > ./bootstrap.sh > @@ -25,11 +30,14 @@ make > rsync pdbg root@bmc:/usr/local/bin > ``` > > -Depending on your cross compile environment, you may get a message like > -`pdbg: No such file or directory` when execting the binary on the BMC, > -which may be fixable by correcting loader location: > - > -`patchelf --set-interpreter /lib/ld-linux-armhf.so.3 pdbg` > +For hard-float: > +``` > +apt-get install gcc-arm-linux-gnueabihf > +./bootstrap.sh > +./configure --host=arm-linux-gnueabihf CFLAGS="-static" > +make > +rsync pdbg root@bmc:/usr/local/bin > +``` > > ## Usage > > -- > 2.23.0 > > -- > Pdbg mailing list > Pdbg@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/pdbg
Excerpts from Joel Stanley's message of January 15, 2021 2:28 pm: > On Wed, 13 Jan 2021 at 05:28, Nicholas Piggin <npiggin@gmail.com> wrote: >> >> The previous patch was papering over the issue, badly. The cause of >> the problem is that some OpenBMC builds have started to use hard float. >> I didn't look hard enough and my ignorance of the ARM environment (and >> the fact it "worked") made me think this was a more benign configuration >> issue. >> >> So update the build instructions to select the hard-float toolchain >> when necessary. Confirmed this works on Debian. >> >> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> > > Reviewed-by: Joel Stanley <joel@jms.id.au> > > Thanks for getting to the bottom of this. Thanks for the gentle prod to work it out properly :P Thanks, Nick
diff --git a/README.md b/README.md index 7892a8d..e0f4842 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ top level directory. Static linking is supported and can be performed by adding ### Cross compiling for BMC (ARM) +First, work out if your BMC is using the hard or soft float ABI. If the +file /lib/ld-linux.so.3 exists, soft-float. If /lib/ld-linux-armhf.so.3 +exists, hard-float. + +To build for soft-float: ``` apt-get install gcc-arm-linux-gnueabi ./bootstrap.sh @@ -25,11 +30,14 @@ make rsync pdbg root@bmc:/usr/local/bin ``` -Depending on your cross compile environment, you may get a message like -`pdbg: No such file or directory` when execting the binary on the BMC, -which may be fixable by correcting loader location: - -`patchelf --set-interpreter /lib/ld-linux-armhf.so.3 pdbg` +For hard-float: +``` +apt-get install gcc-arm-linux-gnueabihf +./bootstrap.sh +./configure --host=arm-linux-gnueabihf CFLAGS="-static" +make +rsync pdbg root@bmc:/usr/local/bin +``` ## Usage
The previous patch was papering over the issue, badly. The cause of the problem is that some OpenBMC builds have started to use hard float. I didn't look hard enough and my ignorance of the ARM environment (and the fact it "worked") made me think this was a more benign configuration issue. So update the build instructions to select the hard-float toolchain when necessary. Confirmed this works on Debian. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)