Do not pass -fno-PIC when compiling for x86 (since the option is
authorKim Nguyễn <kn@lri.fr>
Mon, 22 Oct 2012 15:45:50 +0000 (17:45 +0200)
committerKim Nguyễn <kn@lri.fr>
Mon, 22 Oct 2012 15:59:07 +0000 (17:59 +0200)
only valid for amd64)

myocamlbuild.ml

index 6f27e4e..6121130 100644 (file)
@@ -20,7 +20,7 @@ let link_flags = [ A"-linkpkg" ]
 let libs_files = List.map (fun s -> "file:" ^ s) cxx_libs_objects
 
 
-let native_compile_flags = ref [A"-fno-PIC"]
+let native_compile_flags = if Sys.word_size = 64 then ref [A"-fno-PIC"] else ref []
 let compile_flags = ref []
 
 let dwsize = sprintf "-DWORDSIZE%i" Sys.word_size