diff mbox series

[2/2] php: disable on configurations using BR2_BINFMT_FLAT

Message ID 20180226203429.25294-2-thomas.petazzoni@bootlin.com
State Accepted
Commit e0eec7a4f752364b5ca2580979f28435be0a41a2
Headers show
Series [1/2] php: add patch to fix build on static-only systems | expand

Commit Message

Thomas Petazzoni Feb. 26, 2018, 8:34 p.m. UTC
BR2_BINFMT_FLAT configurations require the use of elf2flt. However,
PHP uses -export-dynamic which breaks badly with elf2flt. Even a
simple program fails to build:

$ ./output/host/bin/arm-linux-gcc -Wl,-export-dynamic -o toto toto.c
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: section .junk LMA [0000000000000000,0000000000000027] overlaps section .text LMA [0000000000000000,0000000000006d07]

-export-dynamic is clearly not useful for FLAT configurations, which
are always statically linked, but it's quite a bit of work to change
the PHP build system to use it only conditionall.

It looks more like an interaction bug between gcc (which wants to put
the .text section at address 0x0 in its linker script) and elf2flt,
which wants to put its .junk section (containing the .rel.text stuff)
also at address 0x0.

Fixes (works around) the "section overlap" part of:

  http://autobuild.buildroot.net/results/35cbed8927bb10500ecf2816aa728ea240a0be21/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
---
 package/php/Config.in | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Korsgaard Feb. 26, 2018, 10:45 p.m. UTC | #1
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > BR2_BINFMT_FLAT configurations require the use of elf2flt. However,
 > PHP uses -export-dynamic which breaks badly with elf2flt. Even a
 > simple program fails to build:

 > $ ./output/host/bin/arm-linux-gcc -Wl,-export-dynamic -o toto toto.c
 > /home/thomas/projets/buildroot/output/host/opt/ext-toolchain/arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: section .junk LMA [0000000000000000,0000000000000027] overlaps section .text LMA [0000000000000000,0000000000006d07]

 > -export-dynamic is clearly not useful for FLAT configurations, which
 > are always statically linked, but it's quite a bit of work to change
 > the PHP build system to use it only conditionall.

 > It looks more like an interaction bug between gcc (which wants to put
 > the .text section at address 0x0 in its linker script) and elf2flt,
 > which wants to put its .junk section (containing the .rel.text stuff)
 > also at address 0x0.

 > Fixes (works around) the "section overlap" part of:

 >   http://autobuild.buildroot.net/results/35cbed8927bb10500ecf2816aa728ea240a0be21/

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 > Cc: Waldemar Brodkorb <wbx@openadk.org>

Committed, thanks.
diff mbox series

Patch

diff --git a/package/php/Config.in b/package/php/Config.in
index 0fb80063af..11514e04b1 100644
--- a/package/php/Config.in
+++ b/package/php/Config.in
@@ -6,6 +6,10 @@  config BR2_PACKAGE_PHP
 	       !BR2_PACKAGE_PHP_SAPI_FPM &&  \
 	       BR2_USE_MMU
 	select BR2_PACKAGE_PHP_SAPI_CLI if !BR2_USE_MMU
+	# PHP uses -export-dynamic, which breaks with elf2flt with a
+	# message like "ld.real: section .junk LMA [...,...] overlaps
+	# section .text LMA [...,...]"
+	depends on !BR2_BINFMT_FLAT
 	help
 	  PHP  is a widely-used general-purpose scripting
 	  language that is especially suited for Web development