Bug 178910 - devel/llvm: relocation R_X86_64_PC32 against `X86CompilationCallback2' can not be used when making a shared object; recompile with -fPIC
Summary: devel/llvm: relocation R_X86_64_PC32 against `X86CompilationCallback2' can no...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-24 09:30 UTC by O. Hartmann
Modified: 2013-05-28 21:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2013-05-24 09:30:00 UTC
Port devel/llvm fails to buil;d due to the follwoing error:

gmake[2]: Leaving directory `/usr/ports/devel/llvm/work/llvm-3.2.src/lib/Object'
gmake[2]: Entering directory `/usr/ports/devel/llvm/work/llvm-3.2.src/lib/DebugInfo'
llvm[2]: Compiling DIContext.cpp for Release build
llvm[2]: Compiling DWARFAbbreviationDeclaration.cpp for Release build
llvm[2]: Compiling DWARFCompileUnit.cpp for Release build
llvm[2]: Compiling DWARFContext.cpp for Release build
llvm[2]: Compiling DWARFDebugAbbrev.cpp for Release build
llvm[2]: Compiling DWARFDebugArangeSet.cpp for Release build
llvm[2]: Compiling DWARFDebugAranges.cpp for Release build
llvm[2]: Compiling DWARFDebugInfoEntry.cpp for Release build
llvm[2]: Compiling DWARFDebugLine.cpp for Release build
llvm[2]: Compiling DWARFDebugRangeList.cpp for Release build
llvm[2]: Compiling DWARFFormValue.cpp for Release build
llvm[2]: Building Release Archive Library libLLVMDebugInfo.a
gmake[2]: Leaving directory `/usr/ports/devel/llvm/work/llvm-3.2.src/lib/DebugInfo'
gmake[1]: Leaving directory `/usr/ports/devel/llvm/work/llvm-3.2.src/lib'
gmake[1]: Entering directory `/usr/ports/devel/llvm/work/llvm-3.2.src/tools/llvm-shlib'
llvm[1]: Linking Release Shared Library libLLVM-3.2.so
/usr/bin/ld: /usr/ports/devel/llvm/work/llvm-3.2.src/Release/lib/libLLVMX86CodeGen.a(X86JITInfo.o): relocation R_X86_64_PC32 against `X86CompilationCallback2' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [/usr/ports/devel/llvm/work/llvm-3.2.src/Release/lib/libLLVM-3.2.so] Error 1
gmake[1]: Leaving directory `/usr/ports/devel/llvm/work/llvm-3.2.src/tools/llvm-shlib'
gmake: *** [all] Error 1
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm
*** Error code 1
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-24 09:30:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->brooks

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Brooks Davis freebsd_committer freebsd_triage 2013-05-28 21:25:19 UTC
State Changed
From-To: open->closed

Workaround committed in r319327.
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-05-28 21:28:11 UTC
Author: brooks
Date: Tue May 28 20:28:03 2013
New Revision: 319327
URL: http://svnweb.freebsd.org/changeset/ports/319327

Log:
  Work around build problems on some systems running HEAD.
  
  PR:		ports/178910
  Obtained from:	pkgsrc

Added:
  head/devel/llvm/files/patch-lib_Target_X86_X86JITInfo.cpp   (contents, props changed)
Modified:
  head/devel/llvm/Makefile

Modified: head/devel/llvm/Makefile
==============================================================================
--- head/devel/llvm/Makefile	Tue May 28 19:53:05 2013	(r319326)
+++ head/devel/llvm/Makefile	Tue May 28 20:28:03 2013	(r319327)
@@ -7,7 +7,7 @@
 
 PORTNAME=	llvm
 PORTVERSION=	3.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel lang
 MASTER_SITES=	http://llvm.org/releases/${PORTVERSION}/
 DISTNAME=	${PORTNAME}-${PORTVERSION}.src

Added: head/devel/llvm/files/patch-lib_Target_X86_X86JITInfo.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/llvm/files/patch-lib_Target_X86_X86JITInfo.cpp	Tue May 28 20:28:03 2013	(r319327)
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_Target_X86_X86JITInfo.cpp,v 1.1 2013/04/02 12:00:05 joerg Exp $
+$FreeBSD$
+
+It is not yet decided whether extern "C" applies to static functions, so
+be explicit for now.
+
+--- lib/Target/X86/X86JITInfo.cpp.orig	2013-04-01 12:16:22.000000000 +0000
++++ lib/Target/X86/X86JITInfo.cpp
+@@ -342,6 +342,17 @@ extern "C" {
+ /// must locate the start of the stub or call site and pass it into the JIT
+ /// compiler function.
+ extern "C" {
++
++#if !(defined (X86_64_JIT) && defined(_MSC_VER))
++ // the following function is called only from this translation unit,
++ // unless we are under 64bit Windows with MSC, where there is
++ // no support for inline assembly
++static
++#endif
++void LLVM_ATTRIBUTE_USED
++X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr)
++__asm__("X86CompilationCallback2");
++
+ #if !(defined (X86_64_JIT) && defined(_MSC_VER))
+  // the following function is called only from this translation unit,
+  // unless we are under 64bit Windows with MSC, where there is
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"