Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 126505

Summary: dev-libs/gmp-4.1.4 noexecstack patch don't support arm assembly
Product: Gentoo Linux Reporter: Stanislaw Gruszka <stf_xl>
Component: [OLD] LibraryAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: VERIFIED DUPLICATE    
Severity: normal CC: stf_xl
Priority: High    
Version: unspecified   
Hardware: ARM   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Stanislaw Gruszka 2006-03-17 01:54:08 UTC
Portage 2.0.53 (uclibc/arm/2.4, gcc-3.4.5, uclibc-0.9.28-r0, 2.6.15.4-iop1 armv)
=================================================================
System uname: 2.6.15.4-iop1 armv5tel XScale-IOP8032x Family rev 0 (v5l)
Gentoo Base System version 1.6.14
distcc 2.18.3 arm-softfloat-linux-uclibc (protocols 1 and 2) (default port 3632]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="arm"
AUTOCLEAN="yes"
CBUILD="arm-softfloat-linux-uclibc"
CFLAGS="-O2 -pipe -march=armv5t -mtune=xscale -fomit-frame-pointer -msoft-float"
CHOST="arm-softfloat-linux-uclibc"

Arm assembly use % for elf section types (@ is for begin comment) so compilation
fail with:

m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_udiv -DPIC udiv.asm >tmp-udiv.s
 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_udiv -O2 -pipe -march=armv5t -mtune=o
tmp-udiv.s: Assembler messages:
tmp-udiv.s:39: Error: junk at end of line, first unrecognized character is `,'
make[2]: *** [udiv.lo] Error 1
make[2]: *** Waiting for unfinished jobs.. 

I have modify noexecstack patches and seems things works.

localhost files # cat gmp-4.1.4-noexecstack.patch
fixed executable stack as per bug #115038 thanks to Petteri R
Comment 1 Stanislaw Gruszka 2006-03-17 01:54:08 UTC
Portage 2.0.53 (uclibc/arm/2.4, gcc-3.4.5, uclibc-0.9.28-r0, 2.6.15.4-iop1 armv)
=================================================================
System uname: 2.6.15.4-iop1 armv5tel XScale-IOP8032x Family rev 0 (v5l)
Gentoo Base System version 1.6.14
distcc 2.18.3 arm-softfloat-linux-uclibc (protocols 1 and 2) (default port 3632]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="arm"
AUTOCLEAN="yes"
CBUILD="arm-softfloat-linux-uclibc"
CFLAGS="-O2 -pipe -march=armv5t -mtune=xscale -fomit-frame-pointer -msoft-float"
CHOST="arm-softfloat-linux-uclibc"

Arm assembly use % for elf section types (@ is for begin comment) so compilation
fail with:

m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_udiv -DPIC udiv.asm >tmp-udiv.s
 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_udiv -O2 -pipe -march=armv5t -mtune=o
tmp-udiv.s: Assembler messages:
tmp-udiv.s:39: Error: junk at end of line, first unrecognized character is `,'
make[2]: *** [udiv.lo] Error 1
make[2]: *** Waiting for unfinished jobs.. 

I have modify noexecstack patches and seems things works.

localhost files # cat gmp-4.1.4-noexecstack.patch
fixed executable stack as per bug #115038 thanks to Petteri Räty

--- gmp-4.1.4/configure
+++ gmp-4.1.4/configure
@@ -21689,6 +21689,7 @@
 fi
 echo "')" >> $gmp_configm4
 echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
+cat nostackexec>>$gmp_configm4

 # Create Makefiles
 # FIXME: Upcoming version of autoconf/automake may not like broken lines.
--- gmp-4.1.4/nostackexec
+++ gmp-4.1.4/nostackexec
@@ -0,0 +1,3 @@
+#ifdef __ELF__
+#ifdef __arm__
+.section .note.GNU-stack,"",%progbits
+#else
+.section .note.GNU-stack,"",@progbits
+#endif
+#endif

localhost files # cat gmp-4.1.4-nostackexec.patch
--- gmp-4.1.4/acinclude.m4.orig 2005-12-29 19:18:24.000000000 +1100
+++ gmp-4.1.4/acinclude.m4      2005-12-29 19:14:43.000000000 +1100
@@ -878,6 +878,7 @@
 fi
 echo ["')"] >> $gmp_configm4
 echo ["define(\`__CONFIG_M4_INCLUDED__')"] >> $gmp_configm4
+cat nostackexec>>$gmp_configm4
 ])


--- /dev/null   2005-12-18 17:28:06.000000000 +1100
+++ gmp-4.1.4/nostackexec       2005-12-29 19:17:32.000000000 +1100
@@ -0,0 +1,3 @@
+#ifdef __ELF__
+#ifdef __arm__
+.section .note.GNU-stack,"",%progbits
+#else
+.section .note.GNU-stack,"",@progbits
+#endif
+#endif
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-03-17 01:58:15 UTC

*** This bug has been marked as a duplicate of 126501 ***
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-03-17 01:58:38 UTC
.
Comment 4 solar (RETIRED) gentoo-dev 2006-03-17 02:18:38 UTC
(In reply to comment #2)
> .
http://marc.theaimsgroup.com/?l=gentoo-dev&m=114097315432302&w=2