* [Buildroot] [PATCH] package/llvm: add dependency on shared libraries
@ 2018-04-06 9:39 Valentin Korenblit
2018-04-06 11:22 ` Romain Naour
2018-04-06 14:41 ` Thomas Petazzoni
0 siblings, 2 replies; 5+ messages in thread
From: Valentin Korenblit @ 2018-04-06 9:39 UTC (permalink / raw)
To: buildroot
llvm generates libLLVM.so, so it won't work if BR2_STATIC_LIBS is set
Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
---
package/llvm/Config.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/llvm/Config.in b/package/llvm/Config.in
index 70f73f4858..d507acbef1 100644
--- a/package/llvm/Config.in
+++ b/package/llvm/Config.in
@@ -18,6 +18,7 @@ config BR2_PACKAGE_LLVM
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_INSTALL_LIBSTDCPP
+ depends on !BR2_STATIC_LIBS
help
The LLVM Project is a collection of modular and reusable
compiler and toolchain technologies.
--
2.14.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: add dependency on shared libraries
2018-04-06 9:39 [Buildroot] [PATCH] package/llvm: add dependency on shared libraries Valentin Korenblit
@ 2018-04-06 11:22 ` Romain Naour
2018-04-06 14:41 ` Thomas Petazzoni
1 sibling, 0 replies; 5+ messages in thread
From: Romain Naour @ 2018-04-06 11:22 UTC (permalink / raw)
To: buildroot
Hi Valentin,
Le 06/04/2018 ? 11:39, Valentin Korenblit a ?crit?:
> llvm generates libLLVM.so, so it won't work if BR2_STATIC_LIBS is set
>
> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> ---
> package/llvm/Config.in | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/package/llvm/Config.in b/package/llvm/Config.in
> index 70f73f4858..d507acbef1 100644
> --- a/package/llvm/Config.in
> +++ b/package/llvm/Config.in
> @@ -18,6 +18,7 @@ config BR2_PACKAGE_LLVM
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> depends on BR2_TOOLCHAIN_HAS_THREADS
> depends on BR2_INSTALL_LIBSTDCPP
> + depends on !BR2_STATIC_LIBS
This new dependency must be propagated to the comment below and other options
selecting llvm:
comment "llvm needs a toolchain w/ threads, C++, dynamic library, gcc >= 4.8,
host gcc >= 4.8"
depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \
!BR2_STATIC_LIBS \
!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
> help
> The LLVM Project is a collection of modular and reusable
> compiler and toolchain technologies.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: add dependency on shared libraries
2018-04-06 9:39 [Buildroot] [PATCH] package/llvm: add dependency on shared libraries Valentin Korenblit
2018-04-06 11:22 ` Romain Naour
@ 2018-04-06 14:41 ` Thomas Petazzoni
2018-04-06 15:03 ` Valentin Korenblit
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2018-04-06 14:41 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 6 Apr 2018 11:39:58 +0200, Valentin Korenblit wrote:
> llvm generates libLLVM.so, so it won't work if BR2_STATIC_LIBS is set
>
> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Interestingly, I haven't seen any failure of LLVM related to static
libraries reported by the autobuilders.
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: add dependency on shared libraries
2018-04-06 14:41 ` Thomas Petazzoni
@ 2018-04-06 15:03 ` Valentin Korenblit
2018-04-06 20:21 ` Thomas Petazzoni
0 siblings, 1 reply; 5+ messages in thread
From: Valentin Korenblit @ 2018-04-06 15:03 UTC (permalink / raw)
To: buildroot
Hello Thomas,
On 06/04/2018 16:41, Thomas Petazzoni wrote:
> Hello,
>
> On Fri, 6 Apr 2018 11:39:58 +0200, Valentin Korenblit wrote:
>> llvm generates libLLVM.so, so it won't work if BR2_STATIC_LIBS is set
>>
>> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> Interestingly, I haven't seen any failure of LLVM related to static
> libraries reported by the autobuilders.
I think llvm should compile correctly but mesa3d has --enable-llvm-shared-libs.
We can disable that option if BR2_STATIC_ONLY.
> Thomas
Valentin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] package/llvm: add dependency on shared libraries
2018-04-06 15:03 ` Valentin Korenblit
@ 2018-04-06 20:21 ` Thomas Petazzoni
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2018-04-06 20:21 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 6 Apr 2018 17:03:04 +0200, Valentin Korenblit wrote:
> >> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> > Interestingly, I haven't seen any failure of LLVM related to static
> > libraries reported by the autobuilders.
>
> I think llvm should compile correctly but mesa3d has --enable-llvm-shared-libs.
> We can disable that option if BR2_STATIC_ONLY.
LLVM doesn't build properly with BR2_STATIC_LIBS. The following defconfig:
BR2_arm=y
BR2_cortex_a8=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_LLVM=y
fails to build with:
[ 60%] Linking CXX shared module ../../LLVMHello.so
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: /home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../
../arm-buildroot-linux-uclibcgnueabihf/lib/libstdc++.a(eh_globals.o)(.text.__cxa_get_globals_fast+0x10): R_ARM_TLS_LE32 relocation not permitted in shared object
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib/libstdc++.a(eh_globals.o): In function `__cxa_get_globals_fast':
eh_globals.cc:(.text.__cxa_get_globals_fast+0x10): dangerous relocation: unsupported relocation
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: /home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../
../arm-buildroot-linux-uclibcgnueabihf/lib/libstdc++.a(eh_globals.o)(.text.__cxa_get_globals+0x10): R_ARM_TLS_LE32 relocation not permitted in shared object
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib/libstdc++.a(eh_globals.o): In function `__cxa_get_globals':
eh_globals.cc:(.text.__cxa_get_globals+0x10): dangerous relocation: unsupported relocation
/home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libc.a(__uClibc_main.os): In function `__uClibc_fini':
__uClibc_main.c:(.text+0x164): undefined reference to `__fini_array_end'
__uClibc_main.c:(.text+0x168): undefined reference to `__fini_array_start'
__uClibc_main.c:(.text+0x16c): undefined reference to `__fini_array_start'
/home/thomas/buildroot/buildroot/output/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libc.a(__uClibc_main.os): In function `__uClibc_main':
__uClibc_main.c:(.text+0x580): undefined reference to `__preinit_array_start'
__uClibc_main.c:(.text+0x584): undefined reference to `__preinit_array_start'
__uClibc_main.c:(.text+0x588): undefined reference to `__preinit_array_end'
__uClibc_main.c:(.text+0x58c): undefined reference to `__init_array_start'
__uClibc_main.c:(.text+0x590): undefined reference to `__init_array_end'
__uClibc_main.c:(.text+0x594): undefined reference to `__init_array_start'
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: ../../LLVMHello.so: hidden symbol `__fini_array_end' isn't defined
/home/thomas/buildroot/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabihf/6.4.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
lib/Transforms/Hello/CMakeFiles/LLVMHello.dir/build.make:94: recipe for target 'lib/LLVMHello.so' failed
make[4]: *** [lib/LLVMHello.so] Error 1
So basically, it's trying to build a shared library.
Could you fix up your patch to propagate the !BR2_STATIC_LIBS
dependency to:
1. The Config.in comment in package/llvm/Config.in
2. The mesa3d package that selects BR2_PACKAGE_LLVM
And send an updated version ?
Thanks!
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-04-06 20:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-06 9:39 [Buildroot] [PATCH] package/llvm: add dependency on shared libraries Valentin Korenblit
2018-04-06 11:22 ` Romain Naour
2018-04-06 14:41 ` Thomas Petazzoni
2018-04-06 15:03 ` Valentin Korenblit
2018-04-06 20:21 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox