Browse files

Fix error building on some 32 bit targets.

Ignore-this: 212d1935582b619313032033a20834d

Apply patch due to Heinrich Apfelmus (apfelmus@quantentunnel.de). His description
attached below:

"I just tripped over a bug in the  Setup.hs  belonging to  wxc  that
 prevented me from compiling wxHaskell with 32bit architecture.

 The problem is the following: in the function  linkSharedLib , the
 function  runProgram  is commented out and the function  system  is used
 instead. This is not correct because  gcc  may (and in my case: does)
 carry additional command line options! (Besides, the verbose output is
 lost.)

 Apparently, this was done because the   runProgram  didn't work for some
 reason. The reason is that some command line options are actually two
 arguments. In particular, setting the output file via

   "-o " ++ out_dir </> sharedLibName ver basename,

 is not correct, the right way to go about it are two arguments

   "-o", out_dir </> sharedLibName ver basename,

 Same for the "-install_name" option. Four lines need to be changed in
 the  linkCxxOpts  file, then  runProgram  will work."

darcs-hash:20120414142124-75908-2cab48a05599cd3556734f64dbd712a24fe6c619.gz
  • Loading branch information...
1 parent 7e6e043 commit a57ff5139dd7cc894f920f9749575304afdb771e @jodonoghue committed Apr 14, 2012
Showing with 8 additions and 8 deletions.
  1. +6 −6 wxc/Setup.hs
  2. +2 −2 wxc/wxc.cabal
View
12 wxc/Setup.hs
@@ -165,16 +165,16 @@ linkCxxOpts ver out_dir basename basepath =
implib_pathname = normalisePath (out_dir </> "lib" ++ addExtension basename ".a") in
case buildOS of
Windows -> ["--dll", "-shared",
- "-o " ++ out_dir </> sharedLibName ver basename,
+ "-o", out_dir </> sharedLibName ver basename,
"-Wl,--out-implib," ++ "lib" ++ addExtension basename ".a",
"-Wl,--export-all-symbols", "-Wl,--enable-auto-import"]
OSX -> ["-dynamiclib",
- "-o " ++ out_dir </> sharedLibName ver basename,
- "-install_name " ++ basepath </> sharedLibName ver basename,
+ "-o", out_dir </> sharedLibName ver basename,
+ "-install_name", basepath </> sharedLibName ver basename,
"-Wl,-undefined,dynamic_lookup"]
_ -> ["-shared",
"-Wl,-soname,lib" ++ basename ++ ".so",
- "-o " ++ out_dir </> sharedLibName ver basename]
+ "-o", out_dir </> sharedLibName ver basename]
-- | Compile a single source file using the configured gcc, if the object file does not yet
-- exist, or is older than the source file.
@@ -232,8 +232,8 @@ linkSharedLib gcc opts lib_dirs libs objs ver out_dir dll_name dll_path =
opts' = opts ++ linkCxxOpts ver (out_dir') dll_name dll_path
objs' = map normalisePath objs
libs' = ["-lstdc++"] ++ map ("-l" ++) libs
- --runProgram verbose gcc (opts' ++ objs' ++ lib_dirs' ++ libs')
- system $ (unwords ([show . locationPath . programLocation $ gcc] ++ opts' ++ objs' ++ lib_dirs' ++ libs'))
+ runProgram verbose gcc (opts' ++ objs' ++ lib_dirs' ++ libs')
+ --system $ (unwords ([show . locationPath . programLocation $ gcc] ++ opts' ++ objs' ++ lib_dirs' ++ libs'))
return ()
-- | The 'normalise' implementation in System.FilePath does not meet the requirements of
View
4 wxc/wxc.cabal
@@ -1,5 +1,5 @@
name: wxc
-version: 0.90
+version: 0.90.0.2
license: OtherLicense
license-file: LICENSE
maintainer: wxhaskell-devel@lists.sourceforge.net
@@ -157,7 +157,7 @@ library
wxc_types.h
build-depends:
- base,
+ base >= 4 && < 5,
wxdirect >= 0.90
x-dll-sources:

0 comments on commit a57ff51

Please sign in to comment.