Skip to content

Instantly share code, notes, and snippets.

@magnetophon
Created June 21, 2026 12:17
Show Gist options
  • Select an option

  • Save magnetophon/d1e321e29e0a2af3944314dbb0afa3dc to your computer and use it in GitHub Desktop.

Select an option

Save magnetophon/d1e321e29e0a2af3944314dbb0afa3dc to your computer and use it in GitHub Desktop.
From 61f9fd7601f249fcf12c8cce2626f59be0828812 Mon Sep 17 00:00:00 2001
From: Bart Brouns <bart@magnetophon.nl>
Date: Sun, 21 Jun 2026 12:12:09 +0000
Subject: [PATCH] linux: emit non-executable .note.GNU-stack in ScalablePiggy.S
emit-vector-piggy generates ScalablePiggy.S without a .note.GNU-stack
section, so GNU ld infers an executable stack for the LV2/VST3 plugin
.so (and warns about it). Since glibc 2.41, dlopen() refuses to load a
shared object that requests an executable stack, failing with "cannot
enable executable stack as shared object requires".
scripts/linux/generate-lv2-ttl dlopen()s the freshly built plugin to
emit its .ttl manifest, so the build fails at the LV2 packaging step on
any distro shipping glibc >= 2.41 (Arch, recent Nixpkgs, ...).
Emit an explicit non-executable .note.GNU-stack note so the generated
object no longer requests an executable stack. %progbits is used for
portability, since ARM's GAS treats @ as a comment character.
---
scripts/linux/emit-vector-piggy | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/linux/emit-vector-piggy b/scripts/linux/emit-vector-piggy
index 762b3fe..52f1a0a 100755
--- a/scripts/linux/emit-vector-piggy
+++ b/scripts/linux/emit-vector-piggy
@@ -29,6 +29,13 @@ source_file.write(u"""# THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT.
# If you need to modify this file, please read the comment
# in scripts/linux/emit-vector-piggy
+ # Mark the stack as non-executable. Without an explicit note, GNU ld infers
+ # an executable stack (and warns), and since glibc 2.41 dlopen() refuses to
+ # load a shared object that requests one. The Linux LV2 packaging step
+ # (scripts/linux/generate-lv2-ttl) dlopen()s the freshly built plugin, so
+ # without this the build fails on any distro shipping glibc >= 2.41.
+ .section .note.GNU-stack,"",%progbits
+
.section ".rodata", "a"
memorySVGListStart:
--
2.43.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment