* Re: [Buildroot] Forcing linker to look at right library path?
[not found] <mailman.10087.1678750430.50374.buildroot@buildroot.org>
@ 2023-03-14 7:46 ` Andreas Ziegler
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Ziegler @ 2023-03-14 7:46 UTC (permalink / raw)
To: C D; +Cc: buildroot
Hi Chris,
On 2023-03-13 23:33, C D <dellicker@live.com> wrote:
>
> Good afternoon,
>
> I'm running in to an issue with a package linking against libubsan and
> libasan. I've figured out how to compile Buildroot so that it copies
> those libraries to the correct output/target/lib and
> output/target/lib64 locations, but it seems like the package is linking
> to the versions installed in my OS (RHEL 8.7) in /usr/lib64 instead.
Did you use BR2_TOOLCHAIN_EXTRA_LIBS? I would expect them to appear
under /usr/lib[64] on the target.
> So, in /usr/lib64 I have libasan.so.5 and libubsan.so.1, and in
> Buildroot's output/target/lib64 I have libasan.so.6; when I boot into
> Buildroot and run my program, it errors out because it's looking for
> libasan.so.5.
The libraries and pkg-config files need to be present in the toolchain
directory, usually located under output/host/<toolchain-name>/sysroot
(normally ./usr/lib and ./usr/lib/pkg-config).
> What do I need to do for it to point to the correct library location
> when linking? Is this a Buildroot config option, or something I need
> to set up in my Makefile?
This is highly specific to (a) the build system used and (b) the
interaction between Buildroot's and the package's make file.
Standard include paths for headers and libraries are preset in the
toolchain binaries.
Buildroot sets the binary path, and standard environment variables
before executing make in the package build directory.
If your Makefile uses variables that can be overridden, set them from
the Buildroot package make file, using e.g. CONF_ENV (autotools) or
MAKE_ENV (generic).
If the project Makefile uses pkg-config to determine include paths, you
need a build-time dependency on host-pkgconf (and probably set
PKG_CONFIG_PATH).
>
> Thanks,
> Chris
Kind regards,
Andreas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] Forcing linker to look at right library path?
@ 2023-03-13 23:33 C D
2023-03-14 7:58 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 7+ messages in thread
From: C D @ 2023-03-13 23:33 UTC (permalink / raw)
To: buildroot@buildroot.org
[-- Attachment #1.1: Type: text/plain, Size: 761 bytes --]
Good afternoon,
I'm running in to an issue with a package linking against libubsan and libasan. I've figured out how to compile Buildroot so that it copies those libraries to the correct output/target/lib and output/target/lib64 locations, but it seems like the package is linking to the versions installed in my OS (RHEL 8.7) in /usr/lib64 instead.
So, in /usr/lib64 I have libasan.so.5 and libubsan.so.1, and in Buildroot's output/target/lib64 I have libasan.so.6; when I boot into Buildroot and run my program, it errors out because it's looking for libasan.so.5.
What do I need to do for it to point to the correct library location when linking? Is this a Buildroot config option, or something I need to set up in my Makefile?
Thanks,
Chris
[-- Attachment #1.2: Type: text/html, Size: 2672 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] Forcing linker to look at right library path?
2023-03-13 23:33 C D
@ 2023-03-14 7:58 ` Thomas Petazzoni via buildroot
2023-03-14 18:43 ` C D
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-03-14 7:58 UTC (permalink / raw)
To: C D; +Cc: buildroot@buildroot.org
Hello,
On Mon, 13 Mar 2023 23:33:45 +0000
C D <dellicker@live.com> wrote:
> I'm running in to an issue with a package linking against libubsan
> and libasan. I've figured out how to compile Buildroot so that it
> copies those libraries to the correct output/target/lib and
> output/target/lib64 locations, but it seems like the package is
> linking to the versions installed in my OS (RHEL 8.7) in /usr/lib64
> instead.
>
> So, in /usr/lib64 I have libasan.so.5 and libubsan.so.1, and in
> Buildroot's output/target/lib64 I have libasan.so.6; when I boot into
> Buildroot and run my program, it errors out because it's looking for
> libasan.so.5.
The Buildroot cross-compiler doesn't look for libraries in
target/usr/lib, but in staging/usr/lib. Having shared libraries in
target/usr/lib is important for your applications to work at run-time
on the target, but those shared libraries should also be present in
staging/usr/lib for the cross-compiler to find them at build time.
> What do I need to do for it to point to the correct library location
> when linking? Is this a Buildroot config option, or something I need
> to set up in my Makefile?
The answer entirely depends on which package you're trying to build.
However, first thing would be to make sure that libasan and libubsan
are both in staging/usr/lib. This should already help significantly, as
it means the cross-compiler will find them.
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] Forcing linker to look at right library path?
2023-03-14 7:58 ` Thomas Petazzoni via buildroot
@ 2023-03-14 18:43 ` C D
2023-03-14 21:07 ` Thomas Petazzoni via buildroot
2023-03-15 7:18 ` Peter Korsgaard
0 siblings, 2 replies; 7+ messages in thread
From: C D @ 2023-03-14 18:43 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot@buildroot.org
> From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Sent: Tuesday, March 14, 2023 12:58 AM
> To: C D
> Cc: buildroot@buildroot.org
> Subject: Re: [Buildroot] Forcing linker to look at right library path?
>
> Hello,
>
> On Mon, 13 Mar 2023 23:33:45 +0000
> C D <dellicker@live.com> wrote:
>
> > I'm running in to an issue with a package linking against libubsan
> > and libasan. I've figured out how to compile Buildroot so that it
> > copies those libraries to the correct output/target/lib and
> > output/target/lib64 locations, but it seems like the package is
> > linking to the versions installed in my OS (RHEL 8.7) in /usr/lib64
> > instead.
> >
> > So, in /usr/lib64 I have libasan.so.5 and libubsan.so.1, and in
> > Buildroot's output/target/lib64 I have libasan.so.6; when I boot into
> > Buildroot and run my program, it errors out because it's looking for
> > libasan.so.5.
>
> The Buildroot cross-compiler doesn't look for libraries in
> target/usr/lib, but in staging/usr/lib. Having shared libraries in
> target/usr/lib is important for your applications to work at run-time
> on the target, but those shared libraries should also be present in
> staging/usr/lib for the cross-compiler to find them at build time.
Thanks, this makes sense. I've confirmed that the required libraries are
in both staging and target directories.
> > What do I need to do for it to point to the correct library location
> > when linking? Is this a Buildroot config option, or something I need
> > to set up in my Makefile?
>
> The answer entirely depends on which package you're trying to build.
> However, first thing would be to make sure that libasan and libubsan
> are both in staging/usr/lib. This should already help significantly, as
> it means the cross-compiler will find them.
I'm trying to build sedcli (https://github.com/sedcli/sedcli); the version
I'm building is a slightly modified private branch (added some debugging), but
the Makefile and configure script are basically identical. I went through
the Makefile and added $(DESTDIR) in appropriate locations to make the files
go where they need to, but after running a "make sedcli-reconfigure" I realized
the configure script isn't taking any off options Buildroot is using to attempt
to make it do the right thing, and I'm assuming this is where my problem is.
The output I get from it is:
Wrong option: --target=x86_64-buildroot-linux-gnu
Wrong option: --host=x86_64-buildroot-linux-gnu
Wrong option: --build=x86_64-pc-linux-gnu
Wrong option: --prefix=/usr
Wrong option: --exec-prefix=/usr
Wrong option: --sysconfdir=/etc
Wrong option: --localstatedir=/var
Wrong option: --program-prefix=
Wrong option: --disable-gtk-doc
Wrong option: --disable-gtk-doc-html
Wrong option: --disable-doc
Wrong option: --disable-docs
Wrong option: --disable-documentation
Wrong option: --with-xmlto=no
Wrong option: --with-fop=no
Wrong option: --disable-dependency-tracking
Wrong option: --enable-ipv6
Wrong option: --disable-nls
Wrong option: --disable-static
Wrong option: --enable-shared
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbootlin.com%2F&data=05%7C01%7C%7C949137e634e94cd4b4dd08db2461e466%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638143775080541793%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zeXwvCO%2Fuj%2FGysbE7uhyVKJfrFA6dGa0cMe%2B5yQvh2I%3D&reserved=0
Thanks,
Chris
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] Forcing linker to look at right library path?
2023-03-14 18:43 ` C D
@ 2023-03-14 21:07 ` Thomas Petazzoni via buildroot
2023-03-15 7:18 ` Peter Korsgaard
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-03-14 21:07 UTC (permalink / raw)
To: C D; +Cc: buildroot@buildroot.org
On Tue, 14 Mar 2023 18:43:29 +0000
C D <dellicker@live.com> wrote:
> I'm trying to build sedcli (https://github.com/sedcli/sedcli); the version
> I'm building is a slightly modified private branch (added some debugging), but
> the Makefile and configure script are basically identical. I went through
> the Makefile and added $(DESTDIR) in appropriate locations to make the files
> go where they need to, but after running a "make sedcli-reconfigure" I realized
> the configure script isn't taking any off options Buildroot is using to attempt
> to make it do the right thing, and I'm assuming this is where my problem is.
> The output I get from it is:
Could you push a Buildroot branch with your package added, and a
defconfig that allows to reproduce the problem? This will be needed to
give you some meaningful support.
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] Forcing linker to look at right library path?
2023-03-14 18:43 ` C D
2023-03-14 21:07 ` Thomas Petazzoni via buildroot
@ 2023-03-15 7:18 ` Peter Korsgaard
2023-03-15 19:59 ` C D
1 sibling, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2023-03-15 7:18 UTC (permalink / raw)
To: C D; +Cc: Thomas Petazzoni, buildroot@buildroot.org
>>>>> "C" == C D <dellicker@live.com> writes:
Hi,
> I'm trying to build sedcli (https://github.com/sedcli/sedcli); the version
> I'm building is a slightly modified private branch (added some debugging), but
> the Makefile and configure script are basically identical. I went through
> the Makefile and added $(DESTDIR) in appropriate locations to make the files
> go where they need to, but after running a "make sedcli-reconfigure" I realized
> the configure script isn't taking any off options Buildroot is using to attempt
> to make it do the right thing, and I'm assuming this is where my problem is.
> The output I get from it is:
> Wrong option: --target=x86_64-buildroot-linux-gnu
> Wrong option: --host=x86_64-buildroot-linux-gnu
> Wrong option: --build=x86_64-pc-linux-gnu
> Wrong option: --prefix=/usr
> Wrong option: --exec-prefix=/usr
> Wrong option: --sysconfdir=/etc
> Wrong option: --localstatedir=/var
> Wrong option: --program-prefix=
> Wrong option: --disable-gtk-doc
> Wrong option: --disable-gtk-doc-html
> Wrong option: --disable-doc
> Wrong option: --disable-docs
> Wrong option: --disable-documentation
> Wrong option: --with-xmlto=no
> Wrong option: --with-fop=no
> Wrong option: --disable-dependency-tracking
> Wrong option: --enable-ipv6
> Wrong option: --disable-nls
> Wrong option: --disable-static
> Wrong option: --enable-shared
It sounds like you have configured this as an autotools package, but
looking at https://github.com/sedcli/sedcli/blob/master/src/configure I
see that it is a custom hand written script, so that is why it doesn't
understand all of these options. Use generic-package instead.
Notice that we already have a package for sedutil, which sounds as if it
does more-or-less the same as this sedcli.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] Forcing linker to look at right library path?
2023-03-15 7:18 ` Peter Korsgaard
@ 2023-03-15 19:59 ` C D
0 siblings, 0 replies; 7+ messages in thread
From: C D @ 2023-03-15 19:59 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: Thomas Petazzoni, buildroot@buildroot.org
> From: Peter Korsgaard <peter@korsgaard.com>
> Sent: Wednesday, March 15, 2023 12:18 AM
> To: C D
> Cc: Thomas Petazzoni; buildroot@buildroot.org
> Subject: Re: Forcing linker to look at right library path?
>
> >>>>> "C" == C D <dellicker@live.com> writes:
>
> Hi,
>
> > I'm trying to build sedcli
>
<snip>
>
> It sounds like you have configured this as an autotools package, but
> looking at https://github.com/sedcli/sedcli/blob/master/src/configure I
> see that it is a custom hand written script, so that is why it doesn't
> understand all of these options. Use generic-package instead.
>
Thanks, that's a helpful starting point. I'm a bit down that road now, but
having some troubles getting the .mk file set up correctly. I'm very much
still in my early phases of learning how all this is put together. :)
> Notice that we already have a package for sedutil, which sounds as if it
> does more-or-less the same as this sedcli.
Thanks, I did look at sedutil also, but sedcli has a few important features
that sedutil does not; most importantly, it supports KMIP integration which
is essential when using it at scale as part of an automated boot process.
>
> --
> Bye, Peter Korsgaard
Thanks,
Chris
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-15 19:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.10087.1678750430.50374.buildroot@buildroot.org>
2023-03-14 7:46 ` [Buildroot] Forcing linker to look at right library path? Andreas Ziegler
2023-03-13 23:33 C D
2023-03-14 7:58 ` Thomas Petazzoni via buildroot
2023-03-14 18:43 ` C D
2023-03-14 21:07 ` Thomas Petazzoni via buildroot
2023-03-15 7:18 ` Peter Korsgaard
2023-03-15 19:59 ` C D
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.