Don't allow libabc to load extensions at runtime.
authorMorgan Deters <mdeters@cs.nyu.edu>
Wed, 25 Jun 2014 14:07:44 +0000 (10:07 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Wed, 25 Jun 2014 14:36:14 +0000 (10:36 -0400)
contrib/get-abc

index 8e04ca655290aaa456e0171271c7e09e649d94b0..c60e403e678f471156b9e8dd687df1d2093ecd04 100755 (executable)
@@ -42,6 +42,14 @@ cd alanmi-abc-$commit
 cp src/base/main/main.c src/base/main/main.c.orig
 sed 's,^// *#define ABC_LIB *$,#define ABC_LIB,' src/base/main/main.c.orig > src/base/main/main.c
 
+# Strip out libSupport.c, it is in charge of loading extensions and we
+# don't want different behavior based on ABC_LIB_PATH, or based on what
+# .so is in the current directory!
+cp src/base/main/module.make src/base/main/module.make.orig
+grep -v 'libSupport\.c' src/base/main/module.make.orig > src/base/main/module.make
+cp src/base/main/mainInit.c src/base/main/mainInit.c.orig
+sed 's,\( *\)\(.*Libs_Init(\),\1//\2,;s,\( *\)\(.*Libs_End(\),\1//\2,' src/base/main/mainInit.c.orig > src/base/main/mainInit.c
+
 # Build optimized, without readline, without pthreads.
 # These aren't necessary for our usage and we don't want the dependencies.
 make libabc.a OPTFLAGS=-O READLINE=0 PTHREADS=0