-
-opt_Static = lookUp FSLIT("-static")
-opt_Unregisterised = lookUp FSLIT("-funregisterised")
-opt_EmitExternalCore = lookUp FSLIT("-fext-core")
+
+opt_PIC :: Bool
+#if darwin_TARGET_OS && x86_64_TARGET_ARCH
+opt_PIC = True
+#else
+opt_PIC = lookUp (fsLit "-fPIC")
+#endif
+opt_Static :: Bool
+opt_Static = lookUp (fsLit "-static")
+opt_Unregisterised :: Bool
+opt_Unregisterised = lookUp (fsLit "-funregisterised")
+
+-- Derived, not a real option. Determines whether we will be compiling
+-- info tables that reside just before the entry code, or with an
+-- indirection to the entry code. See TABLES_NEXT_TO_CODE in
+-- includes/InfoTables.h.
+tablesNextToCode :: Bool
+tablesNextToCode = not opt_Unregisterised
+ && cGhcEnableTablesNextToCode == "YES"
+
+opt_EmitExternalCore :: Bool
+opt_EmitExternalCore = lookUp (fsLit "-fext-core")