Hello, Everyone.

Attached patch will allow llvm-gcc correctly generate PIC code, when
-fPIC flag is supplied (surely, the PIC codegen patch for LLVM itself
should be applied as well)

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.

diff -r 1c6f13454195 gcc/config/i386/linux.h
--- a/gcc/config/i386/linux.h	Thu Jan 04 10:47:31 2007 +0000
+++ b/gcc/config/i386/linux.h	Sat Jan 06 15:05:34 2007 +0300
@@ -185,3 +185,16 @@ Boston, MA 02111-1307, USA.  */
 
 /* This macro may be overridden in i386/k*bsd-gnu.h.  */
 #define REG_NAME(reg) reg
+
+/* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+
+/* Yes, we're supporting PIC codegen for X86-Linux-ELF target! */
+
+#define LLVM_SET_TARGET_OPTIONS(argvec)              \
+  if (flag_pic)                                      \
+    argvec.push_back ("--relocation-model=pic");     \
+  else                                               \
+    argvec.push_back ("--relocation-model=static")
+#endif
+/* APPLE LOCAL end LLVM */
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to