Skip to contentSkip to conversation

package/shellinabox: fix misdetection of ptsname_r

PATCH In review Waldemar Brodkorb 2 participants 2 messages Aug 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/shellinabox: fix misdetection of ptsname_r

Shellinabox configure fails to detect ptsname_r, because of the following warning binutils 2.39+ emits:
ld: warning: some.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Then the build errors out with:
shellinabox/launcher.c:772:12: error: static declaration of 'ptsname_r' follows non-static declaration

Fixes:
- http://autobuild.buildroot.net/results/3e4/3e478d22e820703ddfd11d1491e631ef8ed6b29b

---
 package/shellinabox/shellinabox.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/shellinabox/shellinabox.mk +4 -0
index 58c1668112..c48b3db96f 100644
@@ -30,4 +30,8 @@ ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
 SHELLINABOX_CONF_OPTS += --disable-utmp
 endif
 
+# shellinabox configure check for ptsname_r is failing when
+# binutils is warning about executable stack
+SHELLINABOX_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -z noexecstack"
+
 $(eval $(autotools-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 21 lines · On Tue, 29 Aug 2023 08:35:05 +0200 Waldemar Brodkorb <[email protected]> wrote:

Shellinabox configure fails to detect ptsname_r, because of the following warning binutils 2.39+ emits:
ld: warning: some.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Then the build errors out with:
shellinabox/launcher.c:772:12: error: static declaration of 'ptsname_r' follows non-static declaration

Fixes:
- http://autobuild.buildroot.net/results/3e4/3e478d22e820703ddfd11d1491e631ef8ed6b29b

---
 package/shellinabox/shellinabox.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/shellinabox/shellinabox.mk +0 -0
index 58c1668112..c48b3db96f 100644

package/shellinabox/shellinabox.mk ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) · line 35

Quoted 6 lines
package/shellinabox/shellinabox.mk +3 -0
@@ -30,4 +30,8 @@ ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
 SHELLINABOX_CONF_OPTS += --disable-utmp
 endif
 
+# shellinabox configure check for ptsname_r is failing when
+# binutils is warning about executable stack
+SHELLINABOX_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -z noexecstack"

The problem is that this is not affecting just the configure check, it is also affecting the actual build of the program.

Also, we have a similar issue here:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Can we find a better / more general solution ?

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot