[erlang-patches] Erlang build issue on OpenBSD -current

Matthew Dempsky matthew@REDACTED
Tue Sep 4 20:58:49 CEST 2012


On OpenBSD, shared objects should be linked with "cc -shared", not "ld
-shared".  This is particularly important now that OpenBSD's C
compiler emits code that depends on crtbeginS.o/crtendS.o much more
frequently than before, and those object files are not linked in by
default when "ld -shared".

Diff below tested on OpenBSD 5.2-current.  Excuse the sloppy
copy/paste whitespace, but it's a trivial patch and I think it needs
to be applied to erts/configure.in instead of erts/configure anyway.

Cheers!

--- erts/configure.orig Tue Sep  4 11:35:01 2012
+++ erts/configure      Tue Sep  4 11:35:01 2012
@@ -35122,6 +35122,10 @@ case $host_os in
                        DED_LDFLAGS="-m32 $DED_LDFLAGS"
                fi
        ;;
+       openbsd*)
+               DED_LD="$CC"
+               DED_LDFLAGS="-shared"
+       ;;
        osf*)
                # NOTE! Whitespace after -rpath is important.
                DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-rpath "



More information about the erlang-patches mailing list