update: [lang/rust] makes clang happy with rustc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

update: [lang/rust] makes clang happy with rustc

Sebastien Marie-3
Hi,

The following diff on lang/rust makes it more cooperative with clang.

It packages a link on libgcc.a, in order to let clang to found it. The
link is inside rust librairies subdir.

I copied the way used by lang/g77.

Once commited, I will provide diff to cargo to remove the requirement of
gcc4 module (and change my pending diff on ripgrep).

Thanks.
--
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/rust/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- Makefile 5 May 2017 11:40:29 -0000 1.42
+++ Makefile 15 May 2017 13:14:16 -0000
@@ -9,6 +9,7 @@ COMMENT-main = compiler for Rust Langua
 COMMENT-doc = html documentation for rustc
 
 V = 1.17.0
+REVISION = 0
 DISTNAME = rustc-${V}-src
 
 # rustc bootstrap version
@@ -73,6 +74,11 @@ MODPY_RUNDEP = No
 BUILD_DEPENDS += devel/llvm \
  devel/cmake
 
+# libgcc.a path
+CONFIG = ${MACHINE_ARCH}-unknown-openbsd${OSREV}
+SYSV = 4.2.1
+SYSLIBPATH = /usr/lib/gcc-lib/${CONFIG}/${SYSV}
+
 # rustllvm need c++11
 MODGCC4_LANGS = c++
 MODGCC4_ARCHS = * # patches required for base clang
@@ -183,6 +189,9 @@ post-install:
  ${PREFIX}/lib/rustlib/{install.log,uninstall.sh,rust-installer-version} \
  ${PREFIX}/lib/rustlib/components \
  ${PREFIX}/lib/rustlib/manifest-*
+ # make a link to libgcc.a inside rustlib
+ ln -fs ${SYSLIBPATH}/libgcc.a \
+ ${PREFIX}/lib/rustlib/${TRIPLE_ARCH}/lib
 
 do-test:
  ${BUILD_BIN} test --verbose --jobs=${MAKE_JOBS} ${TEST_TARGET}
Index: pkg/PFRAG.amd64-main
===================================================================
RCS file: /cvs/ports/lang/rust/pkg/PFRAG.amd64-main,v
retrieving revision 1.3
diff -u -p -r1.3 PFRAG.amd64-main
--- pkg/PFRAG.amd64-main 5 May 2017 11:40:29 -0000 1.3
+++ pkg/PFRAG.amd64-main 15 May 2017 13:14:16 -0000
@@ -47,6 +47,7 @@ lib/rustlib/x86_64-unknown-openbsd/lib/l
 lib/rustlib/x86_64-unknown-openbsd/lib/libcore-082780785615d424.rlib
 lib/rustlib/x86_64-unknown-openbsd/lib/libflate-f8dd427e4b8c5b4c.so
 lib/rustlib/x86_64-unknown-openbsd/lib/libfmt_macros-448396db99515941.so
+lib/rustlib/x86_64-unknown-openbsd/lib/libgcc.a
 lib/rustlib/x86_64-unknown-openbsd/lib/libgetopts-dd68a95b56420ce2.rlib
 lib/rustlib/x86_64-unknown-openbsd/lib/libgetopts-dd68a95b56420ce2.so
 lib/rustlib/x86_64-unknown-openbsd/lib/libgraphviz-0c715aa7b22d8559.so
Index: pkg/PFRAG.i386-main
===================================================================
RCS file: /cvs/ports/lang/rust/pkg/PFRAG.i386-main,v
retrieving revision 1.3
diff -u -p -r1.3 PFRAG.i386-main
--- pkg/PFRAG.i386-main 5 May 2017 11:40:29 -0000 1.3
+++ pkg/PFRAG.i386-main 15 May 2017 13:14:16 -0000
@@ -47,6 +47,7 @@ lib/rustlib/i686-unknown-openbsd/lib/lib
 lib/rustlib/i686-unknown-openbsd/lib/libcore-84e6a2caa4fb3d55.rlib
 lib/rustlib/i686-unknown-openbsd/lib/libflate-b7e6eb08021d17dd.so
 lib/rustlib/i686-unknown-openbsd/lib/libfmt_macros-52ed932153d68799.so
+lib/rustlib/i686-unknown-openbsd/lib/libgcc.a
 lib/rustlib/i686-unknown-openbsd/lib/libgetopts-8af7689ae63241f7.rlib
 lib/rustlib/i686-unknown-openbsd/lib/libgetopts-8af7689ae63241f7.so
 lib/rustlib/i686-unknown-openbsd/lib/libgraphviz-b32814278f223978.so