Skip to content

Fix build for armv7 #14801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2024
Merged

Fix build for armv7 #14801

merged 1 commit into from
Jul 6, 2024

Conversation

andypost
Copy link
Contributor

@andypost andypost commented Jul 3, 2024

Started packaging 8.4_alpha1 for Alpinelinux and faced build failure for armv7 and armhf using clang 18..1.8

<inline asm>:1:41: error: expected '%<type>' or "<type>"
    1 | .pushsection ".debug_gdb_scripts", "MS",@progbits,1
      |                                         ^
<inline asm>:1008:12: error: .popsection without corresponding .pushsection
 1008 | .popsection
      |            ^
2 errors generated.
make: *** [Makefile:3100: main/debug_gdb_scripts.lo] Error 1

quick grep showed that other sections has %progbits instead of @progbits

@andypost andypost requested a review from bukka as a code owner July 3, 2024 23:06
@andypost
Copy link
Contributor Author

andypost commented Jul 3, 2024

@SakiTakamachi is it too late for alpha1 to be fixed?

@Girgias
Copy link
Member

Girgias commented Jul 3, 2024

@SakiTakamachi is it too late for alpha1 to be fixed?

Yes, we don't retag versions.

@andypost
Copy link
Contributor Author

andypost commented Jul 4, 2024

Looks it needs more fixes to pass CI but with the patch Alpine finished building

PHP Fatal error:  Uncaught ValueError: Unknown format specifier "p" in /home/runner/work/php-src/php-src/scripts/gdb/debug_gdb_scripts_gen.php:45
Stack trace:
#0 /home/runner/work/php-src/php-src/scripts/gdb/debug_gdb_scripts_gen.php(45): sprintf()
#1 {main}
  thrown in /home/runner/work/php-src/php-src/scripts/gdb/debug_gdb_scripts_gen.php on line 45
make: *** [Makefile:3154: /home/runner/work/php-src/php-src/main/debug_gdb_scripts.c] Error 255

@arnaud-lb
Copy link
Member

Thank you!

Relevant part of the GNU as manual:

Note on targets where the @ character is the start of a comment (eg ARM) then another character is used instead. For example the ARM port uses the % character.

However, it's not clear to me whether the % character is accepted on all platforms or all as versions.

This project uses % only on ARM: https://github.com/mawww/kakoune/blob/e0bbd1e7ca7b96531671682bc63c5ee94d1fbc85/src/main.cc#L1287-L1292. Maybe we should do that?

@andypost
Copy link
Contributor Author

andypost commented Jul 5, 2024

@arnaud-lb I'm using clang18 and only arm failed initially, when I replaced it with % as other places are using then all Alpine arches passed, so I think this 2 places just needs to be fixed for consistency

php-src$ git grep progbits
Zend/asm/jump_arm64_aapcs_elf_gas.S:114:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_arm_aapcs_elf_gas.S:88:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_i386_sysv_elf_gas.S:93:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_loongarch64_sysv_elf_gas.S:121:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_mips32_o32_elf_gas.S:119:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_mips64_n64_elf_gas.S:124:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_ppc32_sysv_elf_gas.S:201:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_ppc64_sysv_elf_gas.S:221:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_riscv64_sysv_elf_gas.S:150:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_s390x_sysv_elf_gas.S:156:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_sparc64_sysv_elf_gas.S:49:.section .note.GNU-stack,"",%progbits
Zend/asm/jump_x86_64_sysv_elf_gas.S:153:.section .note.GNU-stack,"",%progbits
Zend/asm/make_arm64_aapcs_elf_gas.S:85:.section .note.GNU-stack,"",%progbits
Zend/asm/make_arm_aapcs_elf_gas.S:81:.section .note.GNU-stack,"",%progbits
Zend/asm/make_i386_sysv_elf_gas.S:113:.section .note.GNU-stack,"",%progbits
Zend/asm/make_loongarch64_sysv_elf_gas.S:72:.section .note.GNU-stack,"",%progbits
Zend/asm/make_mips32_o32_elf_gas.S:97:.section .note.GNU-stack,"",%progbits
Zend/asm/make_mips64_n64_elf_gas.S:96:.section .note.GNU-stack,"",%progbits
Zend/asm/make_ppc32_sysv_elf_gas.S:146:.section .note.GNU-stack,"",%progbits
Zend/asm/make_ppc64_sysv_elf_gas.S:177:.section .note.GNU-stack,"",%progbits
Zend/asm/make_riscv64_sysv_elf_gas.S:91:.section .note.GNU-stack,"",%progbits
Zend/asm/make_s390x_sysv_elf_gas.S:108:.section .note.GNU-stack,"",%progbits
Zend/asm/make_sparc64_sysv_elf_gas.S:68:.section .note.GNU-stack,"",%progbits
Zend/asm/make_x86_64_sysv_elf_gas.S:189:.section .note.GNU-stack,"",%progbits
main/debug_gdb_scripts.c:10:    ".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
scripts/gdb/debug_gdb_scripts_gen.php:31:        ".pushsection \".debug_gdb_scripts\", \"MS\",%%progbits,1\n"

@arnaud-lb
Copy link
Member

This makes sense. My worry was whether changing to % would possibly break other platforms, but since we use that already in these places, this should be fine.

@arnaud-lb arnaud-lb merged commit 1f64e7c into php:master Jul 6, 2024
11 checks passed
@arnaud-lb
Copy link
Member

Thank you!

arnaud-lb added a commit that referenced this pull request Jul 6, 2024
@andypost andypost deleted the fix-progbits branch July 6, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants