diff mbox

dtc: broken for static builds

Message ID 1389087873-40458-1-git-send-email-Vincent.Riera@imgtec.com
State Accepted
Headers show

Commit Message

Vicente Olivert Riera Jan. 7, 2014, 9:44 a.m. UTC
dtc package has hardcoded shared lib link options in the Makefile, so it
will fail if you try to build it on a static lib environment.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/dtc/Config.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Peter Korsgaard Jan. 9, 2014, 8:14 p.m. UTC | #1
>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:

 > dtc package has hardcoded shared lib link options in the Makefile, so it
 > will fail if you try to build it on a static lib environment.

Really? I just did a quick test build and it seems to work here:

file output/target/usr/bin/dtc
output/target/usr/bin/dtc: ELF 32-bit LSB executable, ARM, version 1
(SYSV), statically linked, stripped
Vicente Olivert Riera Jan. 10, 2014, 2:51 p.m. UTC | #2
On 01/09/2014 08:14 PM, Peter Korsgaard wrote:
>>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:
>
>   > dtc package has hardcoded shared lib link options in the Makefile, so it
>   > will fail if you try to build it on a static lib environment.
>
> Really? I just did a quick test build and it seems to work here:
>
> file output/target/usr/bin/dtc
> output/target/usr/bin/dtc: ELF 32-bit LSB executable, ARM, version 1
> (SYSV), statically linked, stripped
>

I have tried right now with a simple buildroot configuration for x86_64 
and it fails. Please, try to reproduce it following these steps:

-make clean
-make distclean
-make menuconfig
(choose x86_64 target)
(choose prefer static libs)
(choose dtc package)
-save changes
-make
Peter Korsgaard Jan. 10, 2014, 9:59 p.m. UTC | #3
>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:

 > On 01/09/2014 08:14 PM, Peter Korsgaard wrote:
 >>>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:
 >> 
 >> > dtc package has hardcoded shared lib link options in the Makefile, so it
 >> > will fail if you try to build it on a static lib environment.
 >> 
 >> Really? I just did a quick test build and it seems to work here:
 >> 
 >> file output/target/usr/bin/dtc
 >> output/target/usr/bin/dtc: ELF 32-bit LSB executable, ARM, version 1
 >> (SYSV), statically linked, stripped

 > I have tried right now with a simple buildroot configuration for
 > x86_64 and it fails. Please, try to reproduce it following these
 > steps:

 > -make clean
 > -make distclean
 > -make menuconfig
 > (choose x86_64 target)
 > (choose prefer static libs)
 > (choose dtc package)
 > -save changes
 > -make

Ahh yes, I do see it on x86-64. Thanks.
Peter Korsgaard Jan. 10, 2014, 10 p.m. UTC | #4
>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:

 > dtc package has hardcoded shared lib link options in the Makefile, so it
 > will fail if you try to build it on a static lib environment.

 > Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
 > ---
 >  package/dtc/Config.in |    4 ++++
 >  1 files changed, 4 insertions(+), 0 deletions(-)

 > diff --git a/package/dtc/Config.in b/package/dtc/Config.in
 > index fac6ab2..aa9f2b1 100644
 > --- a/package/dtc/Config.in
 > +++ b/package/dtc/Config.in
 > @@ -1,5 +1,6 @@
 >  config BR2_PACKAGE_DTC
 >  	bool "dtc (libfdt)"
 > +	depends on !BR2_PREFER_STATIC_LIB
 >  	help
 >  	  The Device Tree Compiler, dtc, takes as input a device-tree in
 >  	  a given format and outputs a device-tree in another format.
 > @@ -9,6 +10,9 @@ config BR2_PACKAGE_DTC
 
 >  	  http://git.jdl.com/gitweb/?p=dtc.git  (no home page)
 
 > +comment "dtc needs a toolchain w/ dynamic library"
 > +	depends on BR2_PREFER_STATIC_LIB
 > +

Committed with the comment moved below the DTC_PROGRAMS suboption so
that one get indented correctly in menuconfig, thanks.

 >  if BR2_PACKAGE_DTC
 
 >  config BR2_PACKAGE_DTC_PROGRAMS
 > -- 
 > 1.7.1


 > _______________________________________________
 > buildroot mailing list
 > buildroot@busybox.net
 > http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Jan. 28, 2014, 9:01 p.m. UTC | #5
Dear Peter Korsgaard,

On Fri, 10 Jan 2014 22:59:43 +0100, Peter Korsgaard wrote:

>  > I have tried right now with a simple buildroot configuration for
>  > x86_64 and it fails. Please, try to reproduce it following these
>  > steps:
> 
>  > -make clean
>  > -make distclean
>  > -make menuconfig
>  > (choose x86_64 target)
>  > (choose prefer static libs)
>  > (choose dtc package)
>  > -save changes
>  > -make
> 
> Ahh yes, I do see it on x86-64. Thanks.

What did you see on x86-64 exactly? Wasn't it related to libstdc++.a
not being generated by the internal toolchain backend?

Thomas
Vicente Olivert Riera Jan. 30, 2014, 9:35 a.m. UTC | #6
On 01/28/2014 09:01 PM, Thomas Petazzoni wrote:
> Dear Peter Korsgaard,
>
> On Fri, 10 Jan 2014 22:59:43 +0100, Peter Korsgaard wrote:
>
>>   > I have tried right now with a simple buildroot configuration for
>>   > x86_64 and it fails. Please, try to reproduce it following these
>>   > steps:
>>
>>   > -make clean
>>   > -make distclean
>>   > -make menuconfig
>>   > (choose x86_64 target)
>>   > (choose prefer static libs)
>>   > (choose dtc package)
>>   > -save changes
>>   > -make
>>
>> Ahh yes, I do see it on x86-64. Thanks.
>
> What did you see on x86-64 exactly? Wasn't it related to libstdc++.a
> not being generated by the internal toolchain backend?

Hello Thomas,

here you have the log: http://www.pastebin.ca/2601975

Best wishes,

--
Vincent
Peter Korsgaard Feb. 2, 2014, 9:12 p.m. UTC | #7
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> Ahh yes, I do see it on x86-64. Thanks.

 > What did you see on x86-64 exactly? Wasn't it related to libstdc++.a
 > not being generated by the internal toolchain backend?

Sorry, I don't recall the details, but I think the issue was with it
trying to create a shared library and not building the object files with fPIC.
Baruch Siach Feb. 3, 2014, 4:50 a.m. UTC | #8
Hi Peter,

On Sun, Feb 02, 2014 at 10:12:23PM +0100, Peter Korsgaard wrote:
> >>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>  >> Ahh yes, I do see it on x86-64. Thanks.
> 
>  > What did you see on x86-64 exactly? Wasn't it related to libstdc++.a
>  > not being generated by the internal toolchain backend?
> 
> Sorry, I don't recall the details, but I think the issue was with it
> trying to create a shared library and not building the object files with fPIC.

I guess Thomas refers to 7d6c79ed887e (Compile static versions of gcc 
libraries). Before that libstdc++.a was not provided by the internal 
toolchain.

baruch
diff mbox

Patch

diff --git a/package/dtc/Config.in b/package/dtc/Config.in
index fac6ab2..aa9f2b1 100644
--- a/package/dtc/Config.in
+++ b/package/dtc/Config.in
@@ -1,5 +1,6 @@ 
 config BR2_PACKAGE_DTC
 	bool "dtc (libfdt)"
+	depends on !BR2_PREFER_STATIC_LIB
 	help
 	  The Device Tree Compiler, dtc, takes as input a device-tree in
 	  a given format and outputs a device-tree in another format.
@@ -9,6 +10,9 @@  config BR2_PACKAGE_DTC
 
 	  http://git.jdl.com/gitweb/?p=dtc.git  (no home page)
 
+comment "dtc needs a toolchain w/ dynamic library"
+	depends on BR2_PREFER_STATIC_LIB
+
 if BR2_PACKAGE_DTC
 
 config BR2_PACKAGE_DTC_PROGRAMS