aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rwxr-xr-xdev/ocamlopt_shared_os5fix.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/dev/ocamlopt_shared_os5fix.sh b/dev/ocamlopt_shared_os5fix.sh
index db4cb159c4..6782d2fa07 100755
--- a/dev/ocamlopt_shared_os5fix.sh
+++ b/dev/ocamlopt_shared_os5fix.sh
@@ -4,9 +4,15 @@
OCAMLOPT=$1
CMXS=$2
-CMXA=$3
-$OCAMLOPT -dstartup -linkall -shared -o $CMXS $CMXA
+DIR=`dirname $CMXS`
+BASE=`basename $CMXS .cmxs`
+CMXA=$DIR/$BASE.cmxa
+ARC=$DIR/$BASE.a
+# we assume that all object files are at the same place than the rest
+OBJS=`ar t $ARC | sed -e "s|^|$DIR/|"`
+
+"$OCAMLOPT" -dstartup -linkall -shared -o $CMXS $CMXA
# Fix1: add a dummy instruction before the caml generic functions
# Fix2: make all caml generic functions private
rm -f $CMXS $CMXS.startup.fixed.s
@@ -18,6 +24,6 @@ cat $CMXS.startup.s | sed \
> $CMXS.startup.fixed.s
# Recompile fixed startup code
as -o $CMXS.startup.o $CMXS.startup.fixed.s
-# Build fixed .cmxs (assume plugins are on directory base and include all files)
-ld -bundle -flat_namespace -undefined warning -read_only_relocs suppress -o $CMXS `dirname $CMXS`/*.o
+# Build fixed .cmxs (assume all object files are at the same place)
+ld -bundle -flat_namespace -undefined warning -read_only_relocs suppress -o $CMXS $OBJS
rm $CMXS.startup.o $CMXS.startup.s $CMXS.startup.fixed.s \ No newline at end of file