Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin
@ 2016-09-27 22:05 Yann E. MORIN
  2016-09-28  5:49 ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2016-09-27 22:05 UTC (permalink / raw)
  To: buildroot

acpitool requires threads.

However, it does not check fo threads in its configure script, so
forgets to link with -pthreads, so fails to build in static-only
scenarii.

However, upstream has been dead for the past 7+ years now, so there is
not much point trying to fix this. Besides, a system with ACPI is most
probably a biggish system, so shared libs will probably be enabled, so
we just require shared libs.

As for bfin, the cryptic configure failure:
    configure: error: C++ compiler cannot create executables

is due to the order in which AC_PROG_CXX and AC_PROG_CC are called.
Calling AC_PROG_CC first fixes this error message.

But then we get linking errors:

    /home/ymorin/dev/buildroot/O/host/usr/bin/bfin-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os    -o acpitool main.o acpitool.o ac_adapter.o toshiba.o asus.o thinkpad.o cpu.o battery.o freq.o -lgcc
    acpitool.o: In function `Has_ACPI(char*)':
    acpitool.cpp:(.text+0x1be): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Get_Kernel_Version(char*, int)':
    acpitool.cpp:(.text+0x2aa): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Set_Kernel_Version()':
    acpitool.cpp:(.text+0x43e): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Do_Fan_Info(int)':
    acpitool.cpp:(.text+0x60a): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Show_WakeUp_Devices(int)':
    acpitool.cpp:(.text+0x770): undefined reference to `_Unwind_Resume'
    acpitool.o:acpitool.cpp:(.text+0x9ca): more undefined references to `_Unwind_Resume' follow
    /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: acpitool: hidden symbol `___udivsi3' in /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/libgcc.a(_udivsi3.o) is referenced by DSO
    /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status

The last one of those (the hidden ___udivsi3 symbol) is most
concerning, and even the unwind stuff is not trivial.

Again, because upstream is dead, there's not much point trying to fix
this...

Since there's not many chances that a bfin board has ACPI, we just
disable acpitool for bfin.

Fixes various build failures:
    http://autobuild.buildroot.org/results/6fc/6fc568228b7c5c5be9e35aae73fb09b431896325/
    http://autobuild.buildroot.org/results/f1e/f1eb711123c2d8aea8399b8984a007afec4f65fb/
    http://autobuild.buildroot.org/results/70e/70eb7d7ed93a122b4c7a9890877e721b8d777b00/
    [...]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
Changes v1 -> v2:
  - add dependencies on threads and !static
  - update commit log accordingly, fix typoes
---
 package/acpitool/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/acpitool/Config.in b/package/acpitool/Config.in
index 7992e0f..9081bf1 100644
--- a/package/acpitool/Config.in
+++ b/package/acpitool/Config.in
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_ACPITOOL
 	bool "acpitool"
+	depends on !BR2_bfin
 	depends on BR2_INSTALL_LIBSTDCPP
 	help
 	  A small, convenient command-line ACPI client with a lot of
@@ -8,4 +9,5 @@ config BR2_PACKAGE_ACPITOOL
 	  http://acpitool.sourceforge.net
 
 comment "acpitool needs a toolchain w/ C++"
+	depends on !BR2_bfin
 	depends on !BR2_INSTALL_LIBSTDCPP
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin
  2016-09-27 22:05 [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin Yann E. MORIN
@ 2016-09-28  5:49 ` Peter Korsgaard
  2016-09-28 16:37   ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2016-09-28  5:49 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > acpitool requires threads.
 > However, it does not check fo threads in its configure script, so
 > forgets to link with -pthreads, so fails to build in static-only
 > scenarii.

 > However, upstream has been dead for the past 7+ years now, so there is
 > not much point trying to fix this. Besides, a system with ACPI is most
 > probably a biggish system, so shared libs will probably be enabled, so
 > we just require shared libs.

 > As for bfin, the cryptic configure failure:
 >     configure: error: C++ compiler cannot create executables

 > is due to the order in which AC_PROG_CXX and AC_PROG_CC are called.
 > Calling AC_PROG_CC first fixes this error message.

Didn't we conclude this was a toolchain issue?

 > Since there's not many chances that a bfin board has ACPI, we just
 > disable acpitool for bfin.

Agreed.

 > ---
 > Changes v1 -> v2:
 >   - add dependencies on threads and !static

You seem to have forgotten to actually do so?

-- 
Venlig hilsen,
Peter Korsgaard 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin
  2016-09-28  5:49 ` Peter Korsgaard
@ 2016-09-28 16:37   ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2016-09-28 16:37 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2016-09-28 07:49 +0200, Peter Korsgaard spake thusly:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> 
>  > acpitool requires threads.
>  > However, it does not check fo threads in its configure script, so
>  > forgets to link with -pthreads, so fails to build in static-only
>  > scenarii.
> 
>  > However, upstream has been dead for the past 7+ years now, so there is
>  > not much point trying to fix this. Besides, a system with ACPI is most
>  > probably a biggish system, so shared libs will probably be enabled, so
>  > we just require shared libs.
> 
>  > As for bfin, the cryptic configure failure:
>  >     configure: error: C++ compiler cannot create executables
> 
>  > is due to the order in which AC_PROG_CXX and AC_PROG_CC are called.
>  > Calling AC_PROG_CC first fixes this error message.
> 
> Didn't we conclude this was a toolchain issue?

I never said otherwise. I just said that doing so in acpitool's
configure.in would fix the C++ check.

>  > Since there's not many chances that a bfin board has ACPI, we just
>  > disable acpitool for bfin.
> 
> Agreed.
> 
>  > ---
>  > Changes v1 -> v2:
>  >   - add dependencies on threads and !static
> 
> You seem to have forgotten to actually do so?

No I did not. I just did forget to add the file before git --amend.

Damned... :-(

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin
@ 2016-09-28 16:42 Yann E. MORIN
  2016-09-28 20:13 ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2016-09-28 16:42 UTC (permalink / raw)
  To: buildroot

acpitool requires threads.

However, it does not check fo threads in its configure script, so
forgets to link with -pthreads, so fails to build in static-only
scenarii.

However, upstream has been dead for the past 7+ years now, so there is
not much point trying to fix this. Besides, a system with ACPI is most
probably a biggish system, so shared libs will probably be enabled, so
we just require shared libs.

As for bfin, the cryptic configure failure:
    configure: error: C++ compiler cannot create executables

is due to the order in which AC_PROG_CXX and AC_PROG_CC are called.
Calling AC_PROG_CC first fixes this error message in this specific case.
However, this is a toolchain issue, as this does not occur for other
toolchains.

Still, inverting the call would anyway then cause linking errors:

    /home/ymorin/dev/buildroot/O/host/usr/bin/bfin-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os    -o acpitool main.o acpitool.o ac_adapter.o toshiba.o asus.o thinkpad.o cpu.o battery.o freq.o -lgcc
    acpitool.o: In function `Has_ACPI(char*)':
    acpitool.cpp:(.text+0x1be): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Get_Kernel_Version(char*, int)':
    acpitool.cpp:(.text+0x2aa): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Set_Kernel_Version()':
    acpitool.cpp:(.text+0x43e): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Do_Fan_Info(int)':
    acpitool.cpp:(.text+0x60a): undefined reference to `_Unwind_Resume'
    acpitool.o: In function `Show_WakeUp_Devices(int)':
    acpitool.cpp:(.text+0x770): undefined reference to `_Unwind_Resume'
    acpitool.o:acpitool.cpp:(.text+0x9ca): more undefined references to `_Unwind_Resume' follow
    /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: acpitool: hidden symbol `___udivsi3' in /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/libgcc.a(_udivsi3.o) is referenced by DSO
    /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status

Again, because upstream is dead, there's not much point trying to fix
this... And since there's not many chances that a bfin board has ACPI,
we just disable acpitool for bfin.

Fixes various build failures:
    http://autobuild.buildroot.org/results/6fc/6fc568228b7c5c5be9e35aae73fb09b431896325/
    http://autobuild.buildroot.org/results/f1e/f1eb711123c2d8aea8399b8984a007afec4f65fb/
    http://autobuild.buildroot.org/results/70e/70eb7d7ed93a122b4c7a9890877e721b8d777b00/
    [...]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
Changes v2 -> v3:
  - actually add the dependencies on threads and !static  (Peter)
  - tweak commit log to be clear that the C++ issue is a toolchain
    issue  (Peter)

Changes v1 -> v2:
  - add dependencies on threads and !static
  - update commit log accordingly, fix typoes
---
 package/acpitool/Config.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/acpitool/Config.in b/package/acpitool/Config.in
index 7992e0f..a6f082c 100644
--- a/package/acpitool/Config.in
+++ b/package/acpitool/Config.in
@@ -1,5 +1,8 @@
 config BR2_PACKAGE_ACPITOOL
 	bool "acpitool"
+	depends on !BR2_bfin
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_INSTALL_LIBSTDCPP
 	help
 	  A small, convenient command-line ACPI client with a lot of
@@ -7,5 +10,7 @@ config BR2_PACKAGE_ACPITOOL
 
 	  http://acpitool.sourceforge.net
 
-comment "acpitool needs a toolchain w/ C++"
-	depends on !BR2_INSTALL_LIBSTDCPP
+comment "acpitool needs a toolchain w/ threads, C++, dynamic library"
+	depends on !BR2_bfin
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS \
+		|| !BR2_INSTALL_LIBSTDCPP
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin
  2016-09-28 16:42 Yann E. MORIN
@ 2016-09-28 20:13 ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2016-09-28 20:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > acpitool requires threads.
 > However, it does not check fo threads in its configure script, so
 > forgets to link with -pthreads, so fails to build in static-only
 > scenarii.

 > However, upstream has been dead for the past 7+ years now, so there is
 > not much point trying to fix this. Besides, a system with ACPI is most
 > probably a biggish system, so shared libs will probably be enabled, so
 > we just require shared libs.

 > As for bfin, the cryptic configure failure:
 >     configure: error: C++ compiler cannot create executables

 > is due to the order in which AC_PROG_CXX and AC_PROG_CC are called.
 > Calling AC_PROG_CC first fixes this error message in this specific case.
 > However, this is a toolchain issue, as this does not occur for other
 > toolchains.

 > Still, inverting the call would anyway then cause linking errors:

 >     /home/ymorin/dev/buildroot/O/host/usr/bin/bfin-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os    -o acpitool main.o acpitool.o ac_adapter.o toshiba.o asus.o thinkpad.o cpu.o battery.o freq.o -lgcc
 >     acpitool.o: In function `Has_ACPI(char*)':
 >     acpitool.cpp:(.text+0x1be): undefined reference to `_Unwind_Resume'
 >     acpitool.o: In function `Get_Kernel_Version(char*, int)':
 >     acpitool.cpp:(.text+0x2aa): undefined reference to `_Unwind_Resume'
 >     acpitool.o: In function `Set_Kernel_Version()':
 >     acpitool.cpp:(.text+0x43e): undefined reference to `_Unwind_Resume'
 >     acpitool.o: In function `Do_Fan_Info(int)':
 >     acpitool.cpp:(.text+0x60a): undefined reference to `_Unwind_Resume'
 >     acpitool.o: In function `Show_WakeUp_Devices(int)':
 >     acpitool.cpp:(.text+0x770): undefined reference to `_Unwind_Resume'
 >     acpitool.o:acpitool.cpp:(.text+0x9ca): more undefined references to `_Unwind_Resume' follow
 >     /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: acpitool: hidden symbol `___udivsi3' in /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/libgcc.a(_udivsi3.o) is referenced by DSO
 >     /home/ymorin/dev/buildroot/O/host/opt/ext-toolchain/bin/../lib/gcc/bfin-buildroot-linux-uclibc/6.1.0/../../../../bfin-buildroot-linux-uclibc/bin/ld: final link failed: Bad value
 >     collect2: error: ld returned 1 exit status

 > Again, because upstream is dead, there's not much point trying to fix
 > this... And since there's not many chances that a bfin board has ACPI,
 > we just disable acpitool for bfin.

 > Fixes various build failures:
 >     http://autobuild.buildroot.org/results/6fc/6fc568228b7c5c5be9e35aae73fb09b431896325/
 >     http://autobuild.buildroot.org/results/f1e/f1eb711123c2d8aea8399b8984a007afec4f65fb/
 >     http://autobuild.buildroot.org/results/70e/70eb7d7ed93a122b4c7a9890877e721b8d777b00/
 >     [...]

 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Erico Nunes <nunes.erico@gmail.com>
 > Cc: Peter Korsgaard <peter@korsgaard.com>
 > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

 > ---
 > Changes v2 -> v3:
 >   - actually add the dependencies on threads and !static  (Peter)
 >   - tweak commit log to be clear that the C++ issue is a toolchain
 >     issue  (Peter)

Committed, thanks.

-- 
Venlig hilsen,
Peter Korsgaard 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-28 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27 22:05 [Buildroot] [PATCH] package/acpitool: needs threads, shared; unavailable for bfin Yann E. MORIN
2016-09-28  5:49 ` Peter Korsgaard
2016-09-28 16:37   ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2016-09-28 16:42 Yann E. MORIN
2016-09-28 20:13 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox