Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Kamel Bouhara <kamel.bouhara@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/libodb-mysql: don't use mysql_config outside static build
Date: Sun, 14 Nov 2021 15:21:08 +0100	[thread overview]
Message-ID: <20211114152108.134c11d6@windsurf> (raw)
In-Reply-To: <20211113105130.541926-1-fontaine.fabrice@gmail.com>

Hello Fabrice,

On Sat, 13 Nov 2021 11:51:30 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> uclibc (and glibc) installs the following ld script in
> $(STAGING_DIR)/usr/lib/libc.so in addition to the 'standard' library
> installed in $(STAGING_DIR)/lib:
> 
> /* GNU ld script
>  * Use the shared library, but some functions are only in
>  * the static library, so try that secondarily. */
> OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
> 	      "elf32-powerpc")
> GROUP ( /lib/libc.so.1 /usr/lib/uclibc_nonshared.a libpthread_nonshared.a AS_NEEDED ( /lib/ld-uClibc.so.1 ) )
> 
> For an unknown reason, if this script is used, this will result in
> the following build failure:
> 
> configure:3286: /home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/bin/powerpc-buildroot-linux-uclibc-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  conftest.c -rdynamic -L/home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib/mysql -lmysqlclient -L/home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/oracle-mysql/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib -lz -lnsl -lm >&5
> /home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/10.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: cannot find /lib/libc.so.1
> /home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/10.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: cannot find /usr/lib/uclibc_nonshared.a
> /home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/10.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: cannot find /lib/ld-uClibc.so.1
> 
> To fix this build failure, don't use mysql_config outside of static
> builds.

Do you have a minimal defconfig to reproduce the build failure? Indeed,
I remember already seeing and fixing similar issues arising when
BR2_PER_PACKAGE_DIRECTORIES=y (which is enabled in the failing
configuration). And for I remember, this was due to incorrect -L flags.
In the example here, you have two -L:

-L/home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/libodb-mysql/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib/mysql
-L/home/giuliobenetti/autobuild/run/instance-3/output-1/per-package/oracle-mysql/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib

The former is correct, the latter is not, and it does cause this kind
of linker issue. So the real fix (I think!) is not understand why we
have this bogus second -L option, and get rid of it.

You can read the commit log of a18c828bed99d7e0db5128224ffcda4897cd8e80
which explains what is going on.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-11-14 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 10:51 [Buildroot] [PATCH 1/1] package/libodb-mysql: don't use mysql_config outside static build Fabrice Fontaine
2021-11-14 14:21 ` Thomas Petazzoni [this message]
2021-11-14 14:26   ` Fabrice Fontaine

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=20211114152108.134c11d6@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=kamel.bouhara@gmail.com \
    /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