[master] a95399f5b vmodtool.py: Fix VMOD section attribute for macOS compatibility
Nils Goroll
nils.goroll at uplex.de
Wed May 28 18:16:05 UTC 2025
commit a95399f5b9eda1bfdba6ee6406c30a1ed0720167
Author: Rui Chen <rui at chenrui.dev>
Date: Sun May 25 23:54:57 2025 -0400
vmodtool.py: Fix VMOD section attribute for macOS compatibility
Signed-off-by: Rui Chen <rui at chenrui.dev>
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 9bd44c04a..cd0964ba4 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -1255,8 +1255,15 @@ class vcc():
vcs = json.dumps(self.vcs())
vmd = "Vmod_%s_Data" % self.modname
fo.write('\n')
+
+ # Choose section name based on platform compatibility
+ if sys.platform == 'darwin':
+ section_name = '__TEXT,vmod_vcs'
+ else:
+ section_name = '.vmod_vcs'
+
fo.write('static const char vmod_vcs[] ')
- fo.write('v_used_(section(".vmod_vcs")) = %s;\n' % vcs)
+ fo.write('v_used_(section("%s")) = %s;\n' % (section_name, vcs))
for i in (714, 759, 765):
fo.write("/*lint -esym(%d, %s) */\n" % (i, vmd))
fo.write("\nextern const struct vmod_data %s;\n" % vmd)
More information about the varnish-commit
mailing list