Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2018 11:02:47 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r475003 - in head/lang/smlnj: . files
Message-ID:  <201807201102.w6KB2lE6096935@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Fri Jul 20 11:02:47 2018
New Revision: 475003
URL: https://svnweb.freebsd.org/changeset/ports/475003

Log:
  lang/smlnj: Respect LDFLAGS and let LLD_UNSAFE actually work
  
  It currently still tries to use lld.
  
  /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: __stderrp in readonly segment; recompile object files with -fPIC
  >>> defined in /usr/lib32/libc.so.7
  >>> referenced by main.c
  >>>               main.o:(main)
  
  /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: DebugF in readonly segment; recompile object files with -fPIC
  >>> defined in main.o
  >>> referenced by main.c
  >>>               main.o:(main)
  
  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p474314_s336154/logs/smlnj-110.77.log
  
  PR:		226991
  Reported by:	emaste, pkg-fallout

Modified:
  head/lang/smlnj/Makefile
  head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd
  head/lang/smlnj/files/patch-config_install.sh

Modified: head/lang/smlnj/Makefile
==============================================================================
--- head/lang/smlnj/Makefile	Fri Jul 20 10:23:10 2018	(r475002)
+++ head/lang/smlnj/Makefile	Fri Jul 20 11:02:47 2018	(r475003)
@@ -192,7 +192,7 @@ do-build:
 	MLSTANDARDPATCHES=`${MLSTANDARDPATCHES_CMD}` \
 	MLSTANDARDPATCHDIRS=`${MLSTANDARDPATCHDIRS_CMD}` \
 	MLSOURCEPATCHES=`${MLSOURCEPATCHES_CMD}` \
-	CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
+	CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
 	./config/install.sh
 .if defined(ML_RECOMPILE)
 	-${RM} ${WRKSRC}/config/targets.customized
@@ -217,7 +217,7 @@ do-build:
 	cd ${WRKSRC} && unset PWD && \
 	FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
 	MLNORUNTIMECLEAN=yes RECOMPILEDIR="${RECOMPILEDIR}" \
-	CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
+	CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
 	./config/install.sh
 .endif
 
@@ -318,7 +318,7 @@ do-install:
 	FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
 	STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \
 	INSTALLDIR="${STAGEDIR}${MLROOT}" \
-	CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
+	CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
 	./config/install.sh
 .else
 	@${ECHO} '(* Rebuilding the recompiled libs: *)'
@@ -335,7 +335,7 @@ do-install:
 	FILESDIR="${FILESDIR}" PATCH="${PATCH}" PATCH_ARGS="-d ${PATCH_WRKSRC} ${PATCH_ARGS}" \
 	STAGEDIR="${STAGEDIR}" MLLIB="${MLLIB}" \
 	INSTALLDIR="${STAGEDIR}${MLROOT}" RECOMPILEDIR="${RECOMPILEDIR}" \
-	CFLAGS='${CFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
+	CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' AS='${AS}' EXTRA_DEFS='${EXTRA_DEFS}' \
 	./config/install.sh
 .endif
 	[ ! -d ${STAGEDIR} ] || \

Modified: head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd
==============================================================================
--- head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd	Fri Jul 20 10:23:10 2018	(r475002)
+++ head/lang/smlnj/files/do-patch-base_runtime_objs_mk.x86-freebsd	Fri Jul 20 11:02:47 2018	(r475003)
@@ -1,5 +1,5 @@
---- base/runtime/objs/mk.x86-freebsd.orig	2006-04-20 17:28:53.000000000 +0200
-+++ base/runtime/objs/mk.x86-freebsd	2014-07-04 13:12:45.000000000 +0200
+--- base/runtime/objs/mk.x86-freebsd.orig	2006-04-20 15:28:53 UTC
++++ base/runtime/objs/mk.x86-freebsd
 @@ -5,19 +5,19 @@
  
  SHELL =		/bin/sh
@@ -25,13 +25,13 @@
  TARGET =	X86
  VERSION =	v-x86-freebsd
  RUNTIME =	run.x86-freebsd
-@@ -25,6 +25,6 @@
+@@ -25,6 +25,6 @@ RUNTIME_SO =	run.x86-freebsd.so
  RUNTIME_A =	run.x86-freebsd.a
  
  all:
 -	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
 -	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO))
 -	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A))
-+	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
-+	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO))
-+	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A))
++	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="$(LDFLAGS)" $(RUNTIME))
++	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared $(LDFLAGS)" $(RUNTIME_SO))
++	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" MAKE="$(MAKE)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="$(LDFLAGS)" $(RUNTIME_A))

Modified: head/lang/smlnj/files/patch-config_install.sh
==============================================================================
--- head/lang/smlnj/files/patch-config_install.sh	Fri Jul 20 10:23:10 2018	(r475002)
+++ head/lang/smlnj/files/patch-config_install.sh	Fri Jul 20 11:02:47 2018	(r475003)
@@ -1,6 +1,6 @@
---- config/install.sh.orig	2014-08-22 15:20:03.000000000 +0200
-+++ config/install.sh	2014-08-23 14:19:47.061124086 +0200
-@@ -17,6 +17,8 @@
+--- config/install.sh.orig	2014-08-22 13:20:03 UTC
++++ config/install.sh
+@@ -17,6 +17,8 @@ else
      nolib=false
  fi
  
@@ -9,7 +9,7 @@
  if [ x${INSTALL_QUIETLY} = xtrue ] ; then
      export CM_VERBOSE
      CM_VERBOSE=false
-@@ -37,6 +39,28 @@
+@@ -37,6 +39,28 @@ complain() {
      exit 1
  }
  
@@ -38,7 +38,7 @@
  this=$0
  
  
-@@ -96,7 +120,28 @@
+@@ -96,7 +120,28 @@ trap 'cd "$ROOT"; rm -f $tmpfiles' 0 1 2 3 15
  # Especially important is CM_PATHCONFIG.
  #
  export CM_PATHCONFIG
@@ -68,7 +68,7 @@
  #
  # the release version that we are installing
  #
-@@ -326,7 +371,12 @@
+@@ -326,7 +371,12 @@ fi
  # the name of the bin files directory
  #
  BOOT_ARCHIVE=boot.$ARCH-unix
@@ -82,7 +82,7 @@
  
  #
  # build the run-time system
-@@ -335,9 +385,15 @@
+@@ -335,9 +385,15 @@ if [ -x "$RUNDIR"/run.$ARCH-$OPSYS ]; then
      vsay $this: Run-time system already exists.
  else
      "$CONFIGDIR"/unpack "$ROOT" runtime
@@ -94,12 +94,12 @@
      cd "$BASEDIR"/runtime/objs
      echo $this: Compiling the run-time system.
 -    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
-+    echo "$MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS=\""$AS\"" CFLAGS=\"$CFLAGS\""
-+    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS="$AS" CFLAGS="$CFLAGS"
++    echo "$MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS=\""$AS\"" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
++    $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS AS="$AS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
      if [ -x run.$ARCH-$OPSYS ]; then
  	mv run.$ARCH-$OPSYS "$RUNDIR"
  	if [ -f runx.$ARCH-$OPSYS ]; then
-@@ -349,7 +405,7 @@
+@@ -349,7 +405,7 @@ else
  	if [ -f run.$ARCH-$OPSYS.a ]; then
  	    mv run.$ARCH-$OPSYS.a "$RUNDIR"
  	fi
@@ -108,7 +108,7 @@
      else
  	complain "$this: !!! Run-time system build failed for some reason."
      fi
-@@ -375,7 +431,7 @@
+@@ -375,7 +431,7 @@ if [ -r "$HEAPDIR"/sml.$HEAP_SUFFIX ]; then
  	complain "$this !!! Unable to re-create heap image (sml.$HEAP_SUFFIX)."
      fi
  else
@@ -117,7 +117,7 @@
  
      fish "$ROOT"/"$BOOT_FILES"/smlnj/basis
  
-@@ -410,7 +466,7 @@
+@@ -410,7 +466,7 @@ else
  	    cd "$ROOT"/"$BOOT_FILES"
  	    for anchor in * ; do
  		if [ -d $anchor ] ; then
@@ -126,7 +126,7 @@
  		    move $anchor "$LIBDIR"/$anchor
  		fi
  	    done
-@@ -433,6 +489,18 @@
+@@ -433,6 +489,18 @@ installdriver _ml-build ml-build
  
  cd "$ROOT"
  
@@ -145,7 +145,7 @@
  #
  # Now do all the rest using the precompiled installer
  # (see base/system/smlnj/installer for details)
-@@ -442,6 +510,12 @@
+@@ -442,6 +510,12 @@ if [ $nolib = false ] ; then
      export ROOT INSTALLDIR CONFIGDIR BINDIR
      CM_TOLERATE_TOOL_FAILURES=true
      export CM_TOLERATE_TOOL_FAILURES
@@ -158,10 +158,11 @@
      if "$BINDIR"/sml -m \$smlnj/installer.cm
      then
  	vsay $this: Installation complete.
-@@ -450,4 +524,19 @@
+@@ -449,5 +523,20 @@ if [ $nolib = false ] ; then
+ 	complain "$this: !!! Installation of libraries and programs failed."
      fi
  fi
- 
++
 +# Finish staging by removing the $STAGEDIR prefix from the driver scripts.
 +if [ -n "$STAGEDIR" ]
 +then
@@ -176,5 +177,5 @@
 +do
 +	do_patch $p
 +done
-+
+ 
  exit 0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807201102.w6KB2lE6096935>