public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Kenny Bian <kennybian@gmail.com>
To: libc-help@sourceware.org
Subject: Build libc6-2.28 from source: ld-2.28.so cause errors when installing deb package
Date: Wed, 30 Jun 2021 23:01:22 -0700	[thread overview]
Message-ID: <CAC9s0NaM9mn5G0jF6vXaKz=QJtapxKqRtHbZ+ZLq7h2U7=r5Sg@mail.gmail.com> (raw)

We try to build libc6-2.28 from source code. Our board runs Ubuntu
18.04 in armhf architecture. We downloaded the source code from
https://launchpad.net/ubuntu/+source/glibc/2.28-0ubuntu1.
Here is what we did to create the deb package:
1. We build it by using these bash commands:
/usr/bin/dpkg-source -x glibc_2.28-0ubuntu1.dsc libc6-2.28
pushd libc6-2.28/
mkdir build
pushd build/
../configure \
    --host=arm-linux-gnueabihf \
    --prefix=/tmp/armhf/libc6/usr \
    --enable-obsolete-nsl
make
make install

2. Create a deb folder and copy files to this folder. Also put the
control file and post/pre scripts in "DEBIAN" folder in the deb
folder.
3. Create deb file: /usr/bin/dpkg-deb --build --root-owner-group $deb_folder/

The deb file was created. But there are errors when we install the deb
in our armhf board(sudo dpkg -i libc6_2.28-0ubuntu1-my_armhf.deb):
Unpacking libc6:armhf (2.28-0ubuntu1) over (2.28-0ubuntu1) ...
/bin/sh: error while loading shared libraries: libc.so.6: cannot open
shared object file: No such file or directory
dpkg: warning: old libc6:armhf package post-removal script subprocess
returned error exit status 127
dpkg: trying script from the new package instead ...
/bin/sh: error while loading shared libraries: libc.so.6: cannot open
shared object file: No such file or directory
dpkg: error processing archive libc6_2.28-0ubuntu1-my_armhf.deb (--install):
 new libc6:armhf package post-removal script subprocess returned error
exit status 127

After investigation, we finally narrowed it down to "ld-2.28.so". Its
path in the deb file is "lib/arm-linux-gnueabihf/ld-2.28.so". The file
ld-2.28.so built by us will cause the errors above. But the one from
the official deb works fine. We used the file ld-2.28.so from
https://launchpad.net/ubuntu/+source/glibc/2.28-0ubuntu1/+build/15300581/+files/libc6_2.28-0ubuntu1_armhf.deb
to replace the built one in our deb. There will be no errors. The deb
package can be installed properly.

I used the tool readelf, nm and objdump to check the files. There
seems to be no difference between the built file by me and the one
from the official deb. Could you tell me what could be wrong? Is there
anything I can do to investigate it?

Help please!
Thanks in advance!

             reply	other threads:[~2021-07-01  6:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  6:01 Kenny Bian [this message]
2021-07-01  6:42 ` Florian Weimer
2021-07-01 15:52   ` Mike Frysinger
2021-07-01 21:02     ` Florian Weimer
2021-07-02  7:52   ` Kenny Bian

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='CAC9s0NaM9mn5G0jF6vXaKz=QJtapxKqRtHbZ+ZLq7h2U7=r5Sg@mail.gmail.com' \
    --to=kennybian@gmail.com \
    --cc=libc-help@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).