Is there a way to add a dynamic library to every link with GHC automatically?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I'm working with my qnx-nto-arm cross-compiler again. I still have the issue where I get link errors about __aeabi_memcpy and similar. I am able to solve this problem by always adding -lcaps to ghc invocations. I'm still not sure if that library should be required, but it does fix the problem. So now I'm wondering if there's a way to tell my GHC build that when it is built for this platform it should just always link against libcaps as well as whatever else? - -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJUK06LAAoJENEcKRHOUZzekNYQAMMVMpXE1hG0UxFDvKcDzBrD xbK5woDC/7LRhGsXNntG7PM76/vaL51KYenCrPuejYD3xAJXVZY9FifR6yx77qQg ysqX3IZzOQXxAiGDXkkYdf/G2NRIBKhCyCZacY4eCOfRSLVLO58bNbsZI96enrSN j4BTtWoeM/l2wGavV+5QtkDYXrPF7Lg16q1A4w3a7wPLH3YLqeql81gG1qdi55sc nVegs1+Bnr3AzqaMr5n0p5hX0Q+OklNUGVEPRtX6Dh8q7z5MmjKgswXZbukzFUEU wxCSmZYmuQXjYCa0aJkW5J8/2BYBNAkHwTZzZ2GyCtcigCaeaXGppBfEdHk5FHT1 YbyiAheOBJ2ZsTIYdIJEwCGT8KHlxQvruWX3y03LDzV62CX5aMqlISY7oSGY9WM6 ZclMP0mM7whScCdpX2yDsJQV2orSEaWd/9nCF+yVSq4SNpC3fQSzR/aT5PlEpdLh dSnPvPfrDOPdWKF3mITj4P2/oDBO8+iWd6vIUWXjyHrG/iZS5tfeuN9yD8SSudFI l9jiOTPOvOZSyVCXaVEJ0nheUteCM5yAXFN9ipQAuLA10QpH2vt/QpcJ8bvuaMN3 tS+SHr31zV29OZ5nnTaz+Cn8kXaMSSHlgyK/zUjhs2KJAw4XakdzayYS+aLV1Zpz kcs3y8hA/EMu2lTDKYC3 =yv6N -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
So now I'm wondering if there's a way to tell my GHC build that when it is built for this platform it should just always link against libcaps as well as whatever else?
So, I think I've figured it out. Does this look like the best way to acheive what I need: diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 0e17793..68a0c13 100644 - --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1886,6 +1886,10 @@ linkBinary' staticLink dflags o_files dep_packages = do else ["-lpthread"] | otherwise = [] + let qnx_opts + | platformOS platform == OSQNXNTO = ["-lcaps"] + | otherwise = [] + rc_objs <- maybeCreateManifest dflags output_fn let link = if staticLink @@ -1957,6 +1961,7 @@ linkBinary' staticLink dflags o_files dep_packages = do ++ pkg_framework_opts ++ debug_opts ++ thread_opts + ++ qnx_opts )) -- parallel only: move binary to another dir -- HWL - -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJULBgbAAoJENEcKRHOUZzeikQP/ir+JdnO5Hdfe2j13Ut4Plkx cRBK9mbn5bXgojGS/0WZuDLl8A6wn4QlzgeG/4U1GcQTe7EifatfYaRGsnek5dN7 WO7NLKWuo+mUDR6DHowVysWU/II25ddY+iX/6I1ax16SK3iD0+lb0+strw4ble59 Yq2lsrs2PFM9W0reyJxwYjkgqndndUpZ8yzkYeR0L0Mw/7rh+Fepvc8KR27AfEAz 5jSl/7eKUqNW9FAiiNix5vT0vG2awdaDoS8INhzTwYXtJh6qNHTrpdu/TEORFF7V v+vRNTmzmFH5+R5FXhlmCzDpX0FuQdF3xB2doB8XCEaNuwTmJhjMGZIxVZuhMu9s a4sgyhgJWzpHIbwDbDYWfTlYPEYUWGlb8xli8y+qTJ8N73FbYCc8qzwvKJgOZBUi +ezT/Hb2ssgHa9IQojoe7uxVsx9ZYhSksYx8Ah/cVTGP8v6ihl7YgwI2qnobZxNB D3pTkfu3UsnH6GwyjRSOOnV7di/BSeo7INSt0aIM4uuxZJUyGkh2LABLSMLOVEkG fwaN/aIXvw+Nwa7xvYd/BoP9io18uxD6ejUvPJU0NAnXT6QTwn5rp7cr6lMgPAgn oZsg8ZbbENgUTkalyXye6Xe8juVWGPA681ceUn3UQm5QznwfiYdAHbwmNor1qzvU Rd/s6us8hOH33PgUULS6 =P9u0 -----END PGP SIGNATURE-----
participants (1)
-
Stephen Paul Weber