From alrunner4 at gmail.com Wed Dec 11 00:08:20 2013 From: alrunner4 at gmail.com (Alex Carter) Date: Tue, 10 Dec 2013 16:08:20 -0800 Subject: [Haskell-iPhone] Building a Special Cross-Compiler Message-ID: I'm on an interesting journey building a GHC cross-compiler on Windows to target iOS, using a third-party iOS toolchain for Windows (http://www.pmbaty.com/iosbuildenv/ for the curious), and I'm running into an unusual issue. Since this is a cross-compiler, this should be all stage 1, so in ghc_boot_platform.h I see what I expect: ... #define BUILD_OS "mingw32" #define HOST_OS "mingw32" #define TARGET_OS "ios" ... but ghcplatform.h shows: ... #define BUILD_OS "mingw32" #define HOST_OS "ios" ... #define TARGET_OS "ios" ... which I understand to mean that whatever's happening there is set up for the stage 2 compiler (unless there's some good magic happening here with the deriveConstants utility?). I discovered this through a pragma added at the error site: ... rts/Task.h:280:9: note: #pragma message: HOST_OS=ios rts/Task.h:287:5: error: aggregate value used where an integer was expected ... Anybody know what's going on here? Is it right (for some reason beyond my current comprehension) for ghcplatform.h to have the #defines it does? Is HOST_OS=ios correct, but rts/Task.h:280 should also check defined(ios_HOST_OS)? Thanks for the help, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: make.log Type: application/octet-stream Size: 90428 bytes Desc: not available URL: From carter.schonwald at gmail.com Wed Dec 11 05:03:46 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 11 Dec 2013 00:03:46 -0500 Subject: [Haskell-iPhone] Building a Special Cross-Compiler In-Reply-To: References: Message-ID: you may want to ask this on ghc-devs, seems to be a more general cross compiler question than this list is able to handle On Tue, Dec 10, 2013 at 7:08 PM, Alex Carter wrote: > I'm on an interesting journey building a GHC cross-compiler on Windows > to target iOS, using a third-party iOS toolchain for Windows > (http://www.pmbaty.com/iosbuildenv/ for the curious), and I'm running > into an unusual issue. Since this is a cross-compiler, this should be > all stage 1, so in ghc_boot_platform.h I see what I expect: > > ... > #define BUILD_OS "mingw32" > #define HOST_OS "mingw32" > #define TARGET_OS "ios" > ... > > but ghcplatform.h shows: > > ... > #define BUILD_OS "mingw32" > #define HOST_OS "ios" > ... > #define TARGET_OS "ios" > ... > > which I understand to mean that whatever's happening there is set up > for the stage 2 compiler (unless there's some good magic happening > here with the deriveConstants utility?). I discovered this through a > pragma added at the error site: > > ... > rts/Task.h:280:9: note: #pragma message: HOST_OS=ios > rts/Task.h:287:5: error: aggregate value used where an integer was > expected > ... > > Anybody know what's going on here? Is it right (for some reason beyond > my current comprehension) for ghcplatform.h to have the #defines it > does? Is HOST_OS=ios correct, but rts/Task.h:280 should also check > defined(ios_HOST_OS)? > > Thanks for the help, > Alex > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlowsd at gmail.com Wed Dec 11 08:27:24 2013 From: marlowsd at gmail.com (Simon Marlow) Date: Wed, 11 Dec 2013 08:27:24 +0000 Subject: [Haskell-iPhone] Building a Special Cross-Compiler In-Reply-To: References: Message-ID: <52A821EC.2060902@gmail.com> Yes, this is correct. ghc_boot_platform describes the platforms for the stage 1 compiler (assuming you're looking at the one in compiler/stage1). ghcplatform.h describes the platforms in use for compiled code, so the host in that case is ios. In fact ghcplatform.h shouldn't have a target platform at all - the only reason it does is for "backwards compatibility", though I don't remember exactly what goes wrong if we remove these. Cheers, Simon On 11/12/2013 00:08, Alex Carter wrote: > I'm on an interesting journey building a GHC cross-compiler on Windows > to target iOS, using a third-party iOS toolchain for Windows > (http://www.pmbaty.com/iosbuildenv/ for the curious), and I'm running > into an unusual issue. Since this is a cross-compiler, this should be > all stage 1, so in ghc_boot_platform.h I see what I expect: > > ... > #define BUILD_OS "mingw32" > #define HOST_OS "mingw32" > #define TARGET_OS "ios" > ... > > but ghcplatform.h shows: > > ... > #define BUILD_OS "mingw32" > #define HOST_OS "ios" > ... > #define TARGET_OS "ios" > ... > > which I understand to mean that whatever's happening there is set up > for the stage 2 compiler (unless there's some good magic happening > here with the deriveConstants utility?). I discovered this through a > pragma added at the error site: > > ... > rts/Task.h:280:9: note: #pragma message: HOST_OS=ios > rts/Task.h:287:5: error: aggregate value used where an integer was expected > ... > > Anybody know what's going on here? Is it right (for some reason beyond > my current comprehension) for ghcplatform.h to have the #defines it > does? Is HOST_OS=ios correct, but rts/Task.h:280 should also check > defined(ios_HOST_OS)? > > Thanks for the help, > Alex > > > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > From efsubenovex at gmail.com Fri Dec 13 21:35:33 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 13 Dec 2013 13:35:33 -0800 Subject: [Haskell-iPhone] Compilation failure Message-ID: Hi guys, after wanting for months to try out ghc-ios I finally have some time to do it. First off thanks for all the work you've done, I can't wait to get up and running. I seem to be running into a problem early on during make: gcc -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs -P -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -x c compiler/parser/Parser.y.pp | grep -v '^#pragma GCC' > compiler/stage1/build/Parser.y cc1: error: unrecognized command line option "-Wno-invalid-pp-token" cc1: error: unrecognized command line option "-Wno-unicode" make[1]: *** [compiler/stage1/build/Parser.y] Error 1 make[1]: *** Deleting file `compiler/stage1/build/Parser.y' make: *** [all] Error 2 My configure line: ./configure --target=i386-apple-darwin11 --with-gcc=i386-apple-darwin11-clang --with-ghc=/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/bin/ghc Which produces http://lpaste.net/96946. ghc --info: http://lpaste.net/96947 Thanks again. -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Fri Dec 13 23:36:48 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Fri, 13 Dec 2013 15:36:48 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: Hi Schell, Happy to help! Most everything looks good, but if I had to guess it would be that your gcc is *actually* gcc, rather than the fake gcc that modern OS X/Xcode provides. Have you perhaps installed one with brew or otherwise? Here I've got: lukexi at thopminkingscape:~$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.78) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix lukexi at thopminkingscape:~$ which gcc /usr/bin/gcc We've set the build system up to expect the Xcode-installed gcc-which-is-actually-clang so if you can get that one to be primary in the PATH that should get you past this. Cheers Luke On Fri, Dec 13, 2013 at 1:35 PM, Schell Scivally wrote: > Hi guys, after wanting for months to try out ghc-ios I finally have some > time to do it. First off thanks for all the work you've done, I can't wait > to get up and running. I seem to be running into a problem early on during > make: > > gcc -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode > -Wno-trigraphs -P -Iincludes -Iincludes/dist > -Iincludes/dist-derivedconstants/header > -Iincludes/dist-ghcconstants/header -x c compiler/parser/Parser.y.pp | > grep -v '^#pragma GCC' > compiler/stage1/build/Parser.y > > cc1: error: unrecognized command line option "-Wno-invalid-pp-token" > > cc1: error: unrecognized command line option "-Wno-unicode" > > make[1]: *** [compiler/stage1/build/Parser.y] Error 1 > > make[1]: *** Deleting file `compiler/stage1/build/Parser.y' > > make: *** [all] Error 2 > > > My configure line: > > ./configure --target=i386-apple-darwin11 > --with-gcc=i386-apple-darwin11-clang > --with-ghc=/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/bin/ghc > > > Which produces http://lpaste.net/96946. > > > ghc --info: http://lpaste.net/96947 > > > Thanks again. > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Dec 13 23:55:40 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 13 Dec 2013 18:55:40 -0500 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: basically configure the build with ./configure --with-gcc=clang and you should be set then, right? On Fri, Dec 13, 2013 at 6:36 PM, Luke Iannini wrote: > Hi Schell, > > Happy to help! > > Most everything looks good, but if I had to guess it would be that your > gcc is *actually* gcc, rather than the fake gcc that modern OS X/Xcode > provides. Have you perhaps installed one with brew or otherwise? > > Here I've got: > > lukexi at thopminkingscape:~$ gcc -v > Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr > --with-gxx-include-dir=/usr/include/c++/4.2.1 > Apple LLVM version 5.0 (clang-500.2.78) (based on LLVM 3.3svn) > Target: x86_64-apple-darwin13.0.0 > Thread model: posix > lukexi at thopminkingscape:~$ which gcc > /usr/bin/gcc > > We've set the build system up to expect the Xcode-installed > gcc-which-is-actually-clang so if you can get that one to be primary in the > PATH that should get you past this. > > Cheers > Luke > > > On Fri, Dec 13, 2013 at 1:35 PM, Schell Scivally wrote: > >> Hi guys, after wanting for months to try out ghc-ios I finally have some >> time to do it. First off thanks for all the work you've done, I can't wait >> to get up and running. I seem to be running into a problem early on during >> make: >> >> gcc -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode >> -Wno-trigraphs -P -Iincludes -Iincludes/dist >> -Iincludes/dist-derivedconstants/header >> -Iincludes/dist-ghcconstants/header -x c compiler/parser/Parser.y.pp | >> grep -v '^#pragma GCC' > compiler/stage1/build/Parser.y >> >> cc1: error: unrecognized command line option "-Wno-invalid-pp-token" >> >> cc1: error: unrecognized command line option "-Wno-unicode" >> >> make[1]: *** [compiler/stage1/build/Parser.y] Error 1 >> >> make[1]: *** Deleting file `compiler/stage1/build/Parser.y' >> >> make: *** [all] Error 2 >> >> >> My configure line: >> >> ./configure --target=i386-apple-darwin11 >> --with-gcc=i386-apple-darwin11-clang >> --with-ghc=/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/bin/ghc >> >> >> Which produces http://lpaste.net/96946. >> >> >> ghc --info: http://lpaste.net/96947 >> >> >> Thanks again. >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 14 00:13:36 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 13 Dec 2013 16:13:36 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: Yup - these were the issues. I just un-symlinked my gcc from gcc 4.2, which I had installed for building GHC HEAD. Thanks! On Fri, Dec 13, 2013 at 3:55 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > basically configure the build with ./configure --with-gcc=clang and you > should be set then, right? > > > On Fri, Dec 13, 2013 at 6:36 PM, Luke Iannini wrote: > >> Hi Schell, >> >> Happy to help! >> >> Most everything looks good, but if I had to guess it would be that your >> gcc is *actually* gcc, rather than the fake gcc that modern OS X/Xcode >> provides. Have you perhaps installed one with brew or otherwise? >> >> Here I've got: >> >> lukexi at thopminkingscape:~$ gcc -v >> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr >> --with-gxx-include-dir=/usr/include/c++/4.2.1 >> Apple LLVM version 5.0 (clang-500.2.78) (based on LLVM 3.3svn) >> Target: x86_64-apple-darwin13.0.0 >> Thread model: posix >> lukexi at thopminkingscape:~$ which gcc >> /usr/bin/gcc >> >> We've set the build system up to expect the Xcode-installed >> gcc-which-is-actually-clang so if you can get that one to be primary in the >> PATH that should get you past this. >> >> Cheers >> Luke >> >> >> On Fri, Dec 13, 2013 at 1:35 PM, Schell Scivally wrote: >> >>> Hi guys, after wanting for months to try out ghc-ios I finally have some >>> time to do it. First off thanks for all the work you've done, I can't wait >>> to get up and running. I seem to be running into a problem early on during >>> make: >>> >>> gcc -E -undef -traditional -Wno-invalid-pp-token -Wno-unicode >>> -Wno-trigraphs -P -Iincludes -Iincludes/dist >>> -Iincludes/dist-derivedconstants/header >>> -Iincludes/dist-ghcconstants/header -x c compiler/parser/Parser.y.pp | >>> grep -v '^#pragma GCC' > compiler/stage1/build/Parser.y >>> >>> cc1: error: unrecognized command line option "-Wno-invalid-pp-token" >>> >>> cc1: error: unrecognized command line option "-Wno-unicode" >>> >>> make[1]: *** [compiler/stage1/build/Parser.y] Error 1 >>> >>> make[1]: *** Deleting file `compiler/stage1/build/Parser.y' >>> >>> make: *** [all] Error 2 >>> >>> >>> My configure line: >>> >>> ./configure --target=i386-apple-darwin11 >>> --with-gcc=i386-apple-darwin11-clang >>> --with-ghc=/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/bin/ghc >>> >>> >>> Which produces http://lpaste.net/96946. >>> >>> >>> ghc --info: http://lpaste.net/96947 >>> >>> >>> Thanks again. >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >>> _______________________________________________ >>> iPhone mailing list >>> iPhone at haskell.org >>> http://www.haskell.org/mailman/listinfo/iphone >>> >>> >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 14 00:14:46 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 13 Dec 2013 16:14:46 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: It seems I've run into another error: Configuring ghc-pkg-6.9... ghc-cabal: At least the following dependencies are missing: terminfo -any make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Sat Dec 14 02:12:07 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Fri, 13 Dec 2013 18:12:07 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: Hi Schell, That one was supposed to have been fixed: https://ghc.haskell.org/trac/ghc/ticket/7700 so perhaps try doing a "make distclean" and starting again (perl boot, configure etc.) now that you've fixed your gcc issue? Cheers Luke On Fri, Dec 13, 2013 at 4:14 PM, Schell Scivally wrote: > It seems I've run into another error: > > Configuring ghc-pkg-6.9... > > ghc-cabal: At least the following dependencies are missing: > > terminfo -any > > make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 > > make: *** [all] Error 2 > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 14 17:19:52 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sat, 14 Dec 2013 09:19:52 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: Yup - that seemed to clear it up. I've successfully built the simulator cc and am working on the arm cc. Thanks! On Fri, Dec 13, 2013 at 6:12 PM, Luke Iannini wrote: > Hi Schell, > > That one was supposed to have been fixed: > https://ghc.haskell.org/trac/ghc/ticket/7700 so perhaps try doing a "make > distclean" and starting again (perl boot, configure etc.) now that you've > fixed your gcc issue? > > Cheers > Luke > > > On Fri, Dec 13, 2013 at 4:14 PM, Schell Scivally wrote: > >> It seems I've run into another error: >> >> Configuring ghc-pkg-6.9... >> >> ghc-cabal: At least the following dependencies are missing: >> >> terminfo -any >> >> make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 >> >> make: *** [all] Error 2 >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 14 17:57:58 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sat, 14 Dec 2013 09:57:58 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: So it looks like I've run into a problem when building the arm cross-compiler: libtool: compile: arm-apple-darwin10-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -fno-stack-protector -w -c ../src/arm/sysv.S -Wp,-MD,src/arm/.deps/sysv.TPlo -o src/arm/sysv.o *../src/arm/sysv.S:137:1: **warning: **macro defined with named parameters which are not used in macro body, possible positional parameter found in body which will have no effect* .macro ARM_FUNC_START name *^* *../src/arm/sysv.S:224:2: **error: **invalid instruction* stmeqia r2, {r0, r1} * ^* *:5:14: **error: **invalid symbol redefinition* .globl _$0; _$0: * ^* *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* ARM_FUNC_START ffi_closure_SYSV *^* *../src/arm/sysv.S:137:1: **warning: **macro defined with named parameters which are not used in macro body, possible positional parameter found in body which will have no effect* .macro ARM_FUNC_START name *^* *../src/arm/sysv.S:224:2: **error: **invalid instruction* stmeqia r2, {r0, r1} * ^* *:5:14: **error: **invalid symbol redefinition* .globl _$0; _$0: * ^* *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* ARM_FUNC_START ffi_closure_SYSV *^* /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: src/arm/sysv-armv7.o (No such file or directory) rm: src/arm/sysv-armv7.o: No such file or directory rm: src/arm/sysv-armv7s.o: No such file or directory make[5]: *** [src/arm/sysv.lo] Error 1 make[4]: *** [all-recursive] Error 1 make[3]: *** [all] Error 2 make[2]: *** [all-all] Error 2 make[1]: *** [libffi/stamp.ffi.static.build] Error 2 make: *** [all] Error 2 On Sat, Dec 14, 2013 at 9:19 AM, Schell Scivally wrote: > Yup - that seemed to clear it up. I've successfully built the simulator cc > and am working on the arm cc. Thanks! > > > On Fri, Dec 13, 2013 at 6:12 PM, Luke Iannini wrote: > >> Hi Schell, >> >> That one was supposed to have been fixed: >> https://ghc.haskell.org/trac/ghc/ticket/7700 so perhaps try doing a >> "make distclean" and starting again (perl boot, configure etc.) now that >> you've fixed your gcc issue? >> >> Cheers >> Luke >> >> >> On Fri, Dec 13, 2013 at 4:14 PM, Schell Scivally wrote: >> >>> It seems I've run into another error: >>> >>> Configuring ghc-pkg-6.9... >>> >>> ghc-cabal: At least the following dependencies are missing: >>> >>> terminfo -any >>> >>> make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 >>> >>> make: *** [all] Error 2 >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >>> _______________________________________________ >>> iPhone mailing list >>> iPhone at haskell.org >>> http://www.haskell.org/mailman/listinfo/iphone >>> >>> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Sun Dec 15 11:17:32 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Sun, 15 Dec 2013 03:17:32 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: Oops, the wiki had a typo! Step 3 should have been: rm libffi-tarballs/libffi-3.0.11.tar.gz wget https://github.com/ghc-ios/libffi-tarballs/blob/master/libffi-3.0.13z.tar.gz?raw=true -O libffi-tarballs/libffi-3.0.13z.tar.gz I?ve fixed it now, can you try those commands and let me know if it helps? Cheers Luke On Sat, Dec 14, 2013 at 9:57 AM, Schell Scivally wrote: > So it looks like I've run into a problem when building the arm > cross-compiler: > > libtool: compile: arm-apple-darwin10-clang -DHAVE_CONFIG_H -I. -I.. -I. > -I../include -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude > -I../src -DFFI_BUILDING -g -fno-stack-protector -w -c ../src/arm/sysv.S > -Wp,-MD,src/arm/.deps/sysv.TPlo -o src/arm/sysv.o > > *../src/arm/sysv.S:137:1: **warning: **macro defined with named > parameters which are not used in macro body, possible positional parameter > found in body which will have no effect* > > .macro ARM_FUNC_START name > > *^* > > *../src/arm/sysv.S:224:2: **error: **invalid instruction* > > stmeqia r2, {r0, r1} > > * ^* > > *:5:14: **error: **invalid symbol redefinition* > > .globl _$0; _$0: > > * ^* > > *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* > > ARM_FUNC_START ffi_closure_SYSV > > *^* > > *../src/arm/sysv.S:137:1: **warning: **macro defined with named > parameters which are not used in macro body, possible positional parameter > found in body which will have no effect* > > .macro ARM_FUNC_START name > > *^* > > *../src/arm/sysv.S:224:2: **error: **invalid instruction* > > stmeqia r2, {r0, r1} > > * ^* > > *:5:14: **error: **invalid symbol redefinition* > > .globl _$0; _$0: > > * ^* > > *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* > > ARM_FUNC_START ffi_closure_SYSV > > *^* > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: > can't open input file: src/arm/sysv-armv7.o (No such file or directory) > > rm: src/arm/sysv-armv7.o: No such file or directory > > rm: src/arm/sysv-armv7s.o: No such file or directory > > make[5]: *** [src/arm/sysv.lo] Error 1 > > make[4]: *** [all-recursive] Error 1 > > make[3]: *** [all] Error 2 > > make[2]: *** [all-all] Error 2 > > make[1]: *** [libffi/stamp.ffi.static.build] Error 2 > > make: *** [all] Error 2 > > > On Sat, Dec 14, 2013 at 9:19 AM, Schell Scivally wrote: > >> Yup - that seemed to clear it up. I've successfully built the simulator >> cc and am working on the arm cc. Thanks! >> >> >> On Fri, Dec 13, 2013 at 6:12 PM, Luke Iannini wrote: >> >>> Hi Schell, >>> >>> That one was supposed to have been fixed: >>> https://ghc.haskell.org/trac/ghc/ticket/7700 so perhaps try doing a >>> "make distclean" and starting again (perl boot, configure etc.) now that >>> you've fixed your gcc issue? >>> >>> Cheers >>> Luke >>> >>> >>> On Fri, Dec 13, 2013 at 4:14 PM, Schell Scivally wrote: >>> >>>> It seems I've run into another error: >>>> >>>> Configuring ghc-pkg-6.9... >>>> >>>> ghc-cabal: At least the following dependencies are missing: >>>> >>>> terminfo -any >>>> >>>> make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 >>>> >>>> make: *** [all] Error 2 >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>>> _______________________________________________ >>>> iPhone mailing list >>>> iPhone at haskell.org >>>> http://www.haskell.org/mailman/listinfo/iphone >>>> >>>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sun Dec 15 19:33:41 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sun, 15 Dec 2013 11:33:41 -0800 Subject: [Haskell-iPhone] Compilation failure In-Reply-To: References: Message-ID: That fixed it! Thanks guys! On Sun, Dec 15, 2013 at 3:17 AM, Luke Iannini wrote: > Oops, the wiki had a typo! > > Step 3 should have been: > > rm libffi-tarballs/libffi-3.0.11.tar.gz > wget > https://github.com/ghc-ios/libffi-tarballs/blob/master/libffi-3.0.13z.tar.gz?raw=true > -O libffi-tarballs/libffi-3.0.13z.tar.gz > > I?ve fixed it now, can you try those commands and let me know if it helps? > > Cheers > Luke > > > > On Sat, Dec 14, 2013 at 9:57 AM, Schell Scivally wrote: > >> So it looks like I've run into a problem when building the arm >> cross-compiler: >> >> libtool: compile: arm-apple-darwin10-clang -DHAVE_CONFIG_H -I. -I.. -I. >> -I../include -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude >> -I../src -DFFI_BUILDING -g -fno-stack-protector -w -c ../src/arm/sysv.S >> -Wp,-MD,src/arm/.deps/sysv.TPlo -o src/arm/sysv.o >> >> *../src/arm/sysv.S:137:1: **warning: **macro defined with named >> parameters which are not used in macro body, possible positional parameter >> found in body which will have no effect* >> >> .macro ARM_FUNC_START name >> >> *^* >> >> *../src/arm/sysv.S:224:2: **error: **invalid instruction* >> >> stmeqia r2, {r0, r1} >> >> * ^* >> >> *:5:14: **error: **invalid symbol redefinition* >> >> .globl _$0; _$0: >> >> * ^* >> >> *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* >> >> ARM_FUNC_START ffi_closure_SYSV >> >> *^* >> >> *../src/arm/sysv.S:137:1: **warning: **macro defined with named >> parameters which are not used in macro body, possible positional parameter >> found in body which will have no effect* >> >> .macro ARM_FUNC_START name >> >> *^* >> >> *../src/arm/sysv.S:224:2: **error: **invalid instruction* >> >> stmeqia r2, {r0, r1} >> >> * ^* >> >> *:5:14: **error: **invalid symbol redefinition* >> >> .globl _$0; _$0: >> >> * ^* >> >> *../src/arm/sysv.S:269:1: **note: **while in macro instantiation* >> >> ARM_FUNC_START ffi_closure_SYSV >> >> *^* >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >> can't open input file: src/arm/sysv-armv7.o (No such file or directory) >> >> rm: src/arm/sysv-armv7.o: No such file or directory >> >> rm: src/arm/sysv-armv7s.o: No such file or directory >> >> make[5]: *** [src/arm/sysv.lo] Error 1 >> >> make[4]: *** [all-recursive] Error 1 >> >> make[3]: *** [all] Error 2 >> >> make[2]: *** [all-all] Error 2 >> >> make[1]: *** [libffi/stamp.ffi.static.build] Error 2 >> >> make: *** [all] Error 2 >> >> >> On Sat, Dec 14, 2013 at 9:19 AM, Schell Scivally wrote: >> >>> Yup - that seemed to clear it up. I've successfully built the simulator >>> cc and am working on the arm cc. Thanks! >>> >>> >>> On Fri, Dec 13, 2013 at 6:12 PM, Luke Iannini wrote: >>> >>>> Hi Schell, >>>> >>>> That one was supposed to have been fixed: >>>> https://ghc.haskell.org/trac/ghc/ticket/7700 so perhaps try doing a >>>> "make distclean" and starting again (perl boot, configure etc.) now that >>>> you've fixed your gcc issue? >>>> >>>> Cheers >>>> Luke >>>> >>>> >>>> On Fri, Dec 13, 2013 at 4:14 PM, Schell Scivally >>> > wrote: >>>> >>>>> It seems I've run into another error: >>>>> >>>>> Configuring ghc-pkg-6.9... >>>>> >>>>> ghc-cabal: At least the following dependencies are missing: >>>>> >>>>> terminfo -any >>>>> >>>>> make[1]: *** [utils/ghc-pkg/dist-install/package-data.mk] Error 1 >>>>> >>>>> make: *** [all] Error 2 >>>>> >>>>> >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>>> _______________________________________________ >>>>> iPhone mailing list >>>>> iPhone at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/iphone >>>>> >>>>> >>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Mon Dec 16 19:19:05 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Mon, 16 Dec 2013 11:19:05 -0800 Subject: [Haskell-iPhone] arm-apple-darwin10-cabal install woes Message-ID: I'm having trouble installing primitive from hackage with arm-apple-darwin10-cabal. It seems a funky error is happening that is not getting written out or logged. Here is the output from my attempted install from hackage after a `rm -rf ~/.cabal` and `arm-apple-darwin10-cabal update`: http://lpaste.net/97092. Nothiing is listed in the log mentioned. So I tried installing from the git repo and got the same error. Then I tried to configure build and then install and the build phase spat out: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and ar(1) will not be able to operate on it In-place registering primitive-0.5.2.0... So it seems it's building but not linking? Maybe I shouldn't be developing with cabal? What's the normal procedure here? -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Fri Dec 20 22:35:15 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 14:35:15 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD Message-ID: I fixed my earlier problems with compiling primitive and vector by re-compiling ghc-iphone HEAD. It seems now that I can use arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to link it in my Xcode project I get ld warnings: ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (i386): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a I get one of those for each architecture being built (armv7, armv7s, arm64, i386). Here are some details on my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c Any help would be much appreciated! :) -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Dec 20 23:05:09 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 20 Dec 2013 18:05:09 -0500 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: Message-ID: A warning isn't an error. Was there an error or did things work ? On Friday, December 20, 2013, Schell Scivally wrote: > I fixed my earlier problems with compiling primitive and vector by > re-compiling ghc-iphone HEAD. It seems now that I can use > arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to > link it in my Xcode project I get ld warnings: > > ld: warning: ignoring file > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file > was built for archive which is not the architecture being linked (i386): > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a > > I get one of those for each architecture being built (armv7, armv7s, > arm64, i386). Here are some details on my setup: > https://gist.github.com/schell/f3a737171ce2f6b1119c > > Any help would be much appreciated! :) > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Fri Dec 20 23:24:01 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 15:24:01 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: Message-ID: Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined: ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a Undefined symbols for architecture armv7: "_main", referenced from: implicit entry/start for main executable (maybe you meant: _c_main) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) On Fri, Dec 20, 2013 at 3:05 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > A warning isn't an error. Was there an error or did things work ? > > > On Friday, December 20, 2013, Schell Scivally wrote: > >> I fixed my earlier problems with compiling primitive and vector by >> re-compiling ghc-iphone HEAD. It seems now that I can use >> arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to >> link it in my Xcode project I get ld warnings: >> >> ld: warning: ignoring file >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >> was built for archive which is not the architecture being linked (i386): >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >> >> I get one of those for each architecture being built (armv7, armv7s, >> arm64, i386). Here are some details on my setup: >> https://gist.github.com/schell/f3a737171ce2f6b1119c >> >> Any help would be much appreciated! :) >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxwellswadling at gmail.com Sat Dec 21 00:27:55 2013 From: maxwellswadling at gmail.com (Maxwell Swadling) Date: Sat, 21 Dec 2013 11:27:55 +1100 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: Message-ID: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> How are you compiling the static library? What command are you using? __END__ Maxwell Swadling > On 21 Dec 2013, at 10:24 am, Schell Scivally wrote: > > Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined: > > ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a > > ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a > > Undefined symbols for architecture armv7: > > "_main", referenced from: > > implicit entry/start for main executable > > (maybe you meant: _c_main) > > ld: symbol(s) not found for architecture armv7 > > clang: error: linker command failed with exit code 1 (use -v to see invocation) > > > >> On Fri, Dec 20, 2013 at 3:05 PM, Carter Schonwald wrote: >> A warning isn't an error. Was there an error or did things work ? >> >> >>> On Friday, December 20, 2013, Schell Scivally wrote: >>> I fixed my earlier problems with compiling primitive and vector by re-compiling ghc-iphone HEAD. It seems now that I can use arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to link it in my Xcode project I get ld warnings: >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (i386): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> I get one of those for each architecture being built (armv7, armv7s, arm64, i386). Here are some details on my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c >>> Any help would be much appreciated! :) >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan > > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 00:38:12 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 16:38:12 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> Message-ID: Currently I'm using `arm-apple-darwin10-cabal --config-file=path/to/my/arm/config build The cabal file and the rest of the source can be found at https://github.com/schell/blocks-ios/ I'm following the directions at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much as possible but I don't really know how to use ghc to build all the files in a project (when I try it can't find the IOS.Touch module), which is why I'm trying to use cabal. That wiki page says nothing of using cabal so I'm assuming that I'm in dragon territory with most of this, so forgive me if I'm making some obvious mistake. On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling wrote: > How are you compiling the static library? What command are you using? > > __END__ > Maxwell Swadling > > On 21 Dec 2013, at 10:24 am, Schell Scivally > wrote: > > Carter pointed out I only mentioned the warning. ld spits out a warning > and then the build fails in the linking phase because the static lib was > ignored and not linked, making the main() provided by the lib undefined: > > ld: warning: ignoring file > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file > was built for archive which is not the architecture being linked (armv7): > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a > > ld: warning: ignoring file > /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a, file > was built for archive which is not the architecture being linked (armv7): > /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a > > Undefined symbols for architecture armv7: > > "_main", referenced from: > > implicit entry/start for main executable > > (maybe you meant: _c_main) > > ld: symbol(s) not found for architecture armv7 > > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > > On Fri, Dec 20, 2013 at 3:05 PM, Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> A warning isn't an error. Was there an error or did things work ? >> >> >> On Friday, December 20, 2013, Schell Scivally wrote: >> >>> I fixed my earlier problems with compiling primitive and vector by >>> re-compiling ghc-iphone HEAD. It seems now that I can use >>> arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to >>> link it in my Xcode project I get ld warnings: >>> >>> ld: warning: ignoring file >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>> was built for archive which is not the architecture being linked (i386): >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> I get one of those for each architecture being built (armv7, armv7s, >>> arm64, i386). Here are some details on my setup: >>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>> >>> Any help would be much appreciated! :) >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 01:10:07 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 17:10:07 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> Message-ID: I'll sum up the process I'm going through. I `cd` into Blocks where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal --config-file=path/to/arm/config build`. The config file was created by arm-apple-darwin10-cabal the first time I ran it. The build ends in two different ways depending on the `ghc-options` field in the Blocks.cabal file. With ghc-options: -staticlib -threaded it errors (or warns, or outputs - as it isn't specified): Resolving dependencies... Configuring Blocks-0.1.0.0... Building Blocks-0.1.0.0... Preprocessing executable 'Blocks' for Blocks-0.1.0.0... Linking dist-arm/build/Blocks/Blocks.a ... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpthread /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpthread is not an object file (not allowed in a library) With ghc-options: -staticlib it looks like the build completes (with the list of errors mentioned on the wiki). I then have two libs, src/Main.a and dist-arm/build/Blocks/Blocks.a I then add either Blocks.a or Main.a to my project (or both, which I've also tried). Then I build for my device with command-b. Both static libs are ignored for each architecture and then clang ends in a linker error. Here is the build log from Xcode: http://lpaste.net/97304 and my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: https://github.com/schell/blocks-ios/ Please let me know if you need more information. On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: > Currently I'm using `arm-apple-darwin10-cabal > --config-file=path/to/my/arm/config build > > The cabal file and the rest of the source can be found at > https://github.com/schell/blocks-ios/ > > I'm following the directions at > https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much > as possible but I don't really know how to use ghc to build all the files > in a project (when I try it can't find the IOS.Touch module), which is why > I'm trying to use cabal. That wiki page says nothing of using cabal so I'm > assuming that I'm in dragon territory with most of this, so forgive me if > I'm making some obvious mistake. > > > > On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > >> How are you compiling the static library? What command are you using? >> >> __END__ >> Maxwell Swadling >> >> On 21 Dec 2013, at 10:24 am, Schell Scivally >> wrote: >> >> Carter pointed out I only mentioned the warning. ld spits out a warning >> and then the build fails in the linking phase because the static lib was >> ignored and not linked, making the main() provided by the lib undefined: >> >> ld: warning: ignoring file >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >> was built for archive which is not the architecture being linked (armv7): >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >> >> ld: warning: ignoring file >> /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a, file >> was built for archive which is not the architecture being linked (armv7): >> /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a >> >> Undefined symbols for architecture armv7: >> >> "_main", referenced from: >> >> implicit entry/start for main executable >> >> (maybe you meant: _c_main) >> >> ld: symbol(s) not found for architecture armv7 >> >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> >> >> On Fri, Dec 20, 2013 at 3:05 PM, Carter Schonwald < >> carter.schonwald at gmail.com> wrote: >> >>> A warning isn't an error. Was there an error or did things work ? >>> >>> >>> On Friday, December 20, 2013, Schell Scivally wrote: >>> >>>> I fixed my earlier problems with compiling primitive and vector by >>>> re-compiling ghc-iphone HEAD. It seems now that I can use >>>> arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to >>>> link it in my Xcode project I get ld warnings: >>>> >>>> ld: warning: ignoring file >>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>> was built for archive which is not the architecture being linked (i386): >>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>> >>>> I get one of those for each architecture being built (armv7, armv7s, >>>> arm64, i386). Here are some details on my setup: >>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>> >>>> Any help would be much appreciated! :) >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 01:11:39 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 17:11:39 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> Message-ID: Sorry in the last message I meant "(with the list of _warnings_ mentioned on the wiki)". On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: > I'll sum up the process I'm going through. I `cd` into Blocks where > Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal > --config-file=path/to/arm/config build`. The config file was created by > arm-apple-darwin10-cabal the first time I ran it. The build ends in two > different ways depending on the `ghc-options` field in the Blocks.cabal > file. With ghc-options: -staticlib -threaded it errors (or warns, or > outputs - as it isn't specified): > > Resolving dependencies... > > Configuring Blocks-0.1.0.0... > > Building Blocks-0.1.0.0... > > Preprocessing executable 'Blocks' for Blocks-0.1.0.0... > > Linking dist-arm/build/Blocks/Blocks.a ... > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: > can't locate file for: -lpthread > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: > file: -lpthread is not an object file (not allowed in a library) > > With ghc-options: -staticlib it looks like the build completes (with the > list of errors mentioned on the wiki). I then have two libs, src/Main.a and > dist-arm/build/Blocks/Blocks.a > > I then add either Blocks.a or Main.a to my project (or both, which I've > also tried). Then I build for my device with command-b. Both static libs > are ignored for each architecture and then clang ends in a linker error. > Here is the build log from Xcode: http://lpaste.net/97304 and my setup: > https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: > https://github.com/schell/blocks-ios/ > > Please let me know if you need more information. > > > On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: > >> Currently I'm using `arm-apple-darwin10-cabal >> --config-file=path/to/my/arm/config build >> >> The cabal file and the rest of the source can be found at >> https://github.com/schell/blocks-ios/ >> >> I'm following the directions at >> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >> much as possible but I don't really know how to use ghc to build all the >> files in a project (when I try it can't find the IOS.Touch module), which >> is why I'm trying to use cabal. That wiki page says nothing of using cabal >> so I'm assuming that I'm in dragon territory with most of this, so forgive >> me if I'm making some obvious mistake. >> >> >> >> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >>> How are you compiling the static library? What command are you using? >>> >>> __END__ >>> Maxwell Swadling >>> >>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>> wrote: >>> >>> Carter pointed out I only mentioned the warning. ld spits out a warning >>> and then the build fails in the linking phase because the static lib was >>> ignored and not linked, making the main() provided by the lib undefined: >>> >>> ld: warning: ignoring file >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>> was built for archive which is not the architecture being linked (armv7): >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> ld: warning: ignoring file >>> /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a, file >>> was built for archive which is not the architecture being linked (armv7): >>> /Users/schell/Code/blocks-ios/Blocks/dist-i386/build/Blocks/Blocks.a >>> >>> Undefined symbols for architecture armv7: >>> >>> "_main", referenced from: >>> >>> implicit entry/start for main executable >>> >>> (maybe you meant: _c_main) >>> >>> ld: symbol(s) not found for architecture armv7 >>> >>> clang: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> >>> >>> On Fri, Dec 20, 2013 at 3:05 PM, Carter Schonwald < >>> carter.schonwald at gmail.com> wrote: >>> >>>> A warning isn't an error. Was there an error or did things work ? >>>> >>>> >>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>> >>>>> I fixed my earlier problems with compiling primitive and vector by >>>>> re-compiling ghc-iphone HEAD. It seems now that I can use >>>>> arm/i386-apple-darwin10/11-cabal to build a static lib, but when I try to >>>>> link it in my Xcode project I get ld warnings: >>>>> >>>>> ld: warning: ignoring file >>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>> was built for archive which is not the architecture being linked (i386): >>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>> >>>>> I get one of those for each architecture being built (armv7, armv7s, >>>>> arm64, i386). Here are some details on my setup: >>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>> >>>>> Any help would be much appreciated! :) >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >>> _______________________________________________ >>> iPhone mailing list >>> iPhone at haskell.org >>> http://www.haskell.org/mailman/listinfo/iphone >>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Dec 21 01:43:05 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 20 Dec 2013 20:43:05 -0500 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> Message-ID: Aren't there some settings that need to be manipulated in Xcode? Like "don't run strip. Just don't"? Are you doing that stuff? On Friday, December 20, 2013, Schell Scivally wrote: > Sorry in the last message I meant "(with the list of _warnings_ mentioned > on the wiki)". > > > On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: > > I'll sum up the process I'm going through. I `cd` into Blocks where > Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal > --config-file=path/to/arm/config build`. The config file was created by > arm-apple-darwin10-cabal the first time I ran it. The build ends in two > different ways depending on the `ghc-options` field in the Blocks.cabal > file. With ghc-options: -staticlib -threaded it errors (or warns, or > outputs - as it isn't specified): > > Resolving dependencies... > > Configuring Blocks-0.1.0.0... > > Building Blocks-0.1.0.0... > > Preprocessing executable 'Blocks' for Blocks-0.1.0.0... > > Linking dist-arm/build/Blocks/Blocks.a ... > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: > can't locate file for: -lpthread > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: > file: -lpthread is not an object file (not allowed in a library) > > With ghc-options: -staticlib it looks like the build completes (with the > list of errors mentioned on the wiki). I then have two libs, src/Main.a and > dist-arm/build/Blocks/Blocks.a > > I then add either Blocks.a or Main.a to my project (or both, which I've > also tried). Then I build for my device with command-b. Both static libs > are ignored for each architecture and then clang ends in a linker error. > Here is the build log from Xcode: http://lpaste.net/97304 and my setup: > https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: > https://github.com/schell/blocks-ios/ > > Please let me know if you need more information. > > > On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: > > Currently I'm using `arm-apple-darwin10-cabal > --config-file=path/to/my/arm/config build > > The cabal file and the rest of the source can be found at > https://github.com/schell/blocks-ios/ > > I'm following the directions at > https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much > as possible but I don't really know how to use ghc to build all the files > in a project (when I try it can't find the IOS.Touch module), which is why > I'm trying to use cabal. That wiki page says nothing of using cabal so I'm > assuming that I'm in dragon territory with most of this, so forgive me if > I'm making some obvious mistake. > > > > On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > > How are you compiling the static library? What command are you using? > > __END__ > Maxwell Swadling > > On 21 Dec 2013, at 10:24 am, Schell Scivally > wrote: > > Carter pointed out I only mentioned the warning. ld spits out a warning > and then the build fails in the linking phase because the static lib was > ignored and not linked, making the main() provided by the lib undefined: > > ld: warning: ignoring file > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file > was built for archive which is not the architecture being linked (armv7): > /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a > > ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxwellswadling at gmail.com Sat Dec 21 01:49:45 2013 From: maxwellswadling at gmail.com (Maxwell Swadling) Date: Sat, 21 Dec 2013 12:49:45 +1100 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> Message-ID: <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? Also I'm not sure why you have a Main.a as well. You should link the Blocks.a in Xcode. You shouldn't need two .a's. __END__ Maxwell Swadling > On 21 Dec 2013, at 12:43 pm, Carter Schonwald wrote: > > Aren't there some settings that need to be manipulated in Xcode? Like "don't run strip. Just don't"? Are you doing that stuff? > >> On Friday, December 20, 2013, Schell Scivally wrote: >> Sorry in the last message I meant "(with the list of _warnings_ mentioned on the wiki)". >> >> >> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: >> I'll sum up the process I'm going through. I `cd` into Blocks where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal --config-file=path/to/arm/config build`. The config file was created by arm-apple-darwin10-cabal the first time I ran it. The build ends in two different ways depending on the `ghc-options` field in the Blocks.cabal file. With ghc-options: -staticlib -threaded it errors (or warns, or outputs - as it isn't specified): >> Resolving dependencies... >> >> Configuring Blocks-0.1.0.0... >> >> Building Blocks-0.1.0.0... >> >> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >> >> Linking dist-arm/build/Blocks/Blocks.a ... >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpthread >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpthread is not an object file (not allowed in a library) >> >> With ghc-options: -staticlib it looks like the build completes (with the list of errors mentioned on the wiki). I then have two libs, src/Main.a and dist-arm/build/Blocks/Blocks.a >> >> I then add either Blocks.a or Main.a to my project (or both, which I've also tried). Then I build for my device with command-b. Both static libs are ignored for each architecture and then clang ends in a linker error. Here is the build log from Xcode: http://lpaste.net/97304 and my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: https://github.com/schell/blocks-ios/ >> >> Please let me know if you need more information. >> >> >> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: >> Currently I'm using `arm-apple-darwin10-cabal --config-file=path/to/my/arm/config build >> >> The cabal file and the rest of the source can be found at https://github.com/schell/blocks-ios/ >> >> I'm following the directions at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much as possible but I don't really know how to use ghc to build all the files in a project (when I try it can't find the IOS.Touch module), which is why I'm trying to use cabal. That wiki page says nothing of using cabal so I'm assuming that I'm in dragon territory with most of this, so forgive me if I'm making some obvious mistake. >> >> >> >> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling wrote: >> How are you compiling the static library? What command are you using? >> >> __END__ >> Maxwell Swadling >> >>> On 21 Dec 2013, at 10:24 am, Schell Scivally wrote: >>> >>> Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined: >>> >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 02:01:10 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 18:01:10 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: Carter: Yes, I've followed the instructions on the wiki and updated Xcode's build settings. Maxwell: When I try it errors with: arm-apple-darwin10-ghc Main.hs -o Main.a Main.hs:5:8: Could not find module 'IOS.Touch' Use -v to see a list of the files searched for. And then following it down the rabbit hole: arm-apple-darwin10-ghc Main.hs -o Main.a -v Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC version 7.6.3 Using binary package database: /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 wired-in package rts mapped to builtin_rts wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba wired-in package dph-seq not found. wired-in package dph-par not found. Hsc static flags: wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 wired-in package rts mapped to builtin_rts wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba wired-in package dph-seq not found. wired-in package dph-par not found. *** Chasing dependencies: Chasing modules from: *Main.hs Main.hs:5:8: Could not find module 'IOS.Touch' Locations searched: IOS/Touch.hs IOS/Touch.lhs *** Deleting temp files: Deleting: *** Deleting temp dirs: Deleting: So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of the reasons I'm trying to use cabal, since it seems to be pretty good at running hsc2hs on that file automagically. Though ghc is supposed to work with .hsc, no? If I try to compile Touch.hsc by itself I get something interesting: arm-apple-darwin10-ghc IOS/Touch.hsc ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): IOS/Touch.hsc Undefined symbols for architecture armv7: "_ZCMain_main_closure", referenced from: _main in ghc85846_2.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): IOS/Touch.hsc Undefined symbols for architecture armv7s: "_ZCMain_main_closure", referenced from: _main in ghc85846_2.o ld: symbol(s) not found for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: a-armv7.o (No such file or directory) rm: a-armv7.o: No such file or directory rm: a-armv7s.o: No such file or directory On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling wrote: > Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? > > Also I'm not sure why you have a Main.a as well. You should link the > Blocks.a in Xcode. You shouldn't need two .a's. > > __END__ > Maxwell Swadling > > On 21 Dec 2013, at 12:43 pm, Carter Schonwald > wrote: > > Aren't there some settings that need to be manipulated in Xcode? Like > "don't run strip. Just don't"? Are you doing that stuff? > > On Friday, December 20, 2013, Schell Scivally wrote: > >> Sorry in the last message I meant "(with the list of _warnings_ mentioned >> on the wiki)". >> >> >> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: >> >> I'll sum up the process I'm going through. I `cd` into Blocks where >> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >> --config-file=path/to/arm/config build`. The config file was created by >> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >> different ways depending on the `ghc-options` field in the Blocks.cabal >> file. With ghc-options: -staticlib -threaded it errors (or warns, or >> outputs - as it isn't specified): >> >> Resolving dependencies... >> >> Configuring Blocks-0.1.0.0... >> >> Building Blocks-0.1.0.0... >> >> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >> >> Linking dist-arm/build/Blocks/Blocks.a ... >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >> can't locate file for: -lpthread >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >> file: -lpthread is not an object file (not allowed in a library) >> >> With ghc-options: -staticlib it looks like the build completes (with the >> list of errors mentioned on the wiki). I then have two libs, src/Main.a and >> dist-arm/build/Blocks/Blocks.a >> >> I then add either Blocks.a or Main.a to my project (or both, which I've >> also tried). Then I build for my device with command-b. Both static libs >> are ignored for each architecture and then clang ends in a linker error. >> Here is the build log from Xcode: http://lpaste.net/97304 and my setup: >> https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: >> https://github.com/schell/blocks-ios/ >> >> Please let me know if you need more information. >> >> >> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: >> >> Currently I'm using `arm-apple-darwin10-cabal >> --config-file=path/to/my/arm/config build >> >> The cabal file and the rest of the source can be found at >> https://github.com/schell/blocks-ios/ >> >> I'm following the directions at >> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >> much as possible but I don't really know how to use ghc to build all the >> files in a project (when I try it can't find the IOS.Touch module), which >> is why I'm trying to use cabal. That wiki page says nothing of using cabal >> so I'm assuming that I'm in dragon territory with most of this, so forgive >> me if I'm making some obvious mistake. >> >> >> >> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >> How are you compiling the static library? What command are you using? >> >> __END__ >> Maxwell Swadling >> >> On 21 Dec 2013, at 10:24 am, Schell Scivally >> wrote: >> >> Carter pointed out I only mentioned the warning. ld spits out a warning >> and then the build fails in the linking phase because the static lib was >> ignored and not linked, making the main() provided by the lib undefined: >> >> ld: warning: ignoring file >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >> was built for archive which is not the architecture being linked (armv7): >> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >> >> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >> >> -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxwellswadling at gmail.com Sat Dec 21 02:26:58 2013 From: maxwellswadling at gmail.com (Maxwell Swadling) Date: Sat, 21 Dec 2013 13:26:58 +1100 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: > So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of the reasons I'm trying to use cabal, since it seems to be pretty good at running hsc2hs on that file automagically. Though ghc is supposed to work with .hsc, no? > > If I try to compile Touch.hsc by itself I get something interesting: > > arm-apple-darwin10-ghc IOS/Touch.hsc > GHC doesn't! You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will produce `IOS/Touch/Touch.hs`. You will have to add any header include paths you need (CocoaTouch ?). I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. On 21/12/2013, at 1:01 PM, Schell Scivally wrote: > Carter: Yes, I've followed the instructions on the wiki and updated Xcode's build settings. > Maxwell: When I try it errors with: > > arm-apple-darwin10-ghc Main.hs -o Main.a > Main.hs:5:8: > > Could not find module ?IOS.Touch? > > Use -v to see a list of the files searched for. > > > > And then following it down the rabbit hole: > > arm-apple-darwin10-ghc Main.hs -o Main.a -v > > Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC version 7.6.3 > > Using binary package database: /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache > > wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 > > wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff > > wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 > > wired-in package rts mapped to builtin_rts > > wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba > > wired-in package dph-seq not found. > > wired-in package dph-par not found. > > Hsc static flags: > > wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 > > wired-in package integer-simple mapped to integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff > > wired-in package base mapped to base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 > > wired-in package rts mapped to builtin_rts > > wired-in package template-haskell mapped to template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba > > wired-in package dph-seq not found. > > wired-in package dph-par not found. > > *** Chasing dependencies: > > Chasing modules from: *Main.hs > > > > Main.hs:5:8: > > Could not find module ?IOS.Touch? > > Locations searched: > > IOS/Touch.hs > > IOS/Touch.lhs > > *** Deleting temp files: > > Deleting: > > *** Deleting temp dirs: > > > Deleting: > > > > So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of the reasons I'm trying to use cabal, since it seems to be pretty good at running hsc2hs on that file automagically. Though ghc is supposed to work with .hsc, no? > > If I try to compile Touch.hsc by itself I get something interesting: > > arm-apple-darwin10-ghc IOS/Touch.hsc > > ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): IOS/Touch.hsc > > Undefined symbols for architecture armv7: > > "_ZCMain_main_closure", referenced from: > > _main in ghc85846_2.o > > ld: symbol(s) not found for architecture armv7 > > clang: error: linker command failed with exit code 1 (use -v to see invocation) > > ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): IOS/Touch.hsc > > Undefined symbols for architecture armv7s: > > "_ZCMain_main_closure", referenced from: > > _main in ghc85846_2.o > > ld: symbol(s) not found for architecture armv7s > > clang: error: linker command failed with exit code 1 (use -v to see invocation) > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: a-armv7.o (No such file or directory) > > rm: a-armv7.o: No such file or directory > > > rm: a-armv7s.o: No such file or directory > > > > On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling wrote: > Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? > > Also I'm not sure why you have a Main.a as well. You should link the Blocks.a in Xcode. You shouldn't need two .a's. > > __END__ Maxwell Swadling > > On 21 Dec 2013, at 12:43 pm, Carter Schonwald wrote: > >> Aren't there some settings that need to be manipulated in Xcode? Like "don't run strip. Just don't"? Are you doing that stuff? >> >> On Friday, December 20, 2013, Schell Scivally wrote: >> Sorry in the last message I meant "(with the list of _warnings_ mentioned on the wiki)". >> >> >> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: >> I'll sum up the process I'm going through. I `cd` into Blocks where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal --config-file=path/to/arm/config build`. The config file was created by arm-apple-darwin10-cabal the first time I ran it. The build ends in two different ways depending on the `ghc-options` field in the Blocks.cabal file. With ghc-options: -staticlib -threaded it errors (or warns, or outputs - as it isn't specified): >> Resolving dependencies... >> >> Configuring Blocks-0.1.0.0... >> >> Building Blocks-0.1.0.0... >> >> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >> >> Linking dist-arm/build/Blocks/Blocks.a ... >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpthread >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpthread is not an object file (not allowed in a library) >> >> With ghc-options: -staticlib it looks like the build completes (with the list of errors mentioned on the wiki). I then have two libs, src/Main.a and dist-arm/build/Blocks/Blocks.a >> >> I then add either Blocks.a or Main.a to my project (or both, which I've also tried). Then I build for my device with command-b. Both static libs are ignored for each architecture and then clang ends in a linker error. Here is the build log from Xcode: http://lpaste.net/97304 and my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: https://github.com/schell/blocks-ios/ >> >> Please let me know if you need more information. >> >> >> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: >> Currently I'm using `arm-apple-darwin10-cabal --config-file=path/to/my/arm/config build >> >> The cabal file and the rest of the source can be found at https://github.com/schell/blocks-ios/ >> >> I'm following the directions at https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as much as possible but I don't really know how to use ghc to build all the files in a project (when I try it can't find the IOS.Touch module), which is why I'm trying to use cabal. That wiki page says nothing of using cabal so I'm assuming that I'm in dragon territory with most of this, so forgive me if I'm making some obvious mistake. >> >> >> >> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling wrote: >> How are you compiling the static library? What command are you using? >> >> __END__ >> Maxwell Swadling >> >> On 21 Dec 2013, at 10:24 am, Schell Scivally wrote: >> >>> Carter pointed out I only mentioned the warning. ld spits out a warning and then the build fails in the linking phase because the static lib was ignored and not linked, making the main() provided by the lib undefined: >>> >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file was built for archive which is not the architecture being linked (armv7): /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>> > > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 04:08:41 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 20:08:41 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next error is: arm-apple-darwin10-ghc -staticlib Main.hs -threaded IOS/Touch.hsc:6:8: Could not find module 'Data.Vector.Storable' Use -v to see a list of the files searched for. Is there a way for me to manually include the Data.Vector.Storable package? On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling wrote: > So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of > the reasons I'm trying to use cabal, since it seems to be pretty good at > running hsc2hs on that file automagically. Though ghc is supposed to work > with .hsc, no? > > If I try to compile Touch.hsc by itself I get something interesting: > > arm-apple-darwin10-ghc IOS/Touch.hsc > > GHC doesn't! > > You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will produce > `IOS/Touch/Touch.hs`. > > You will have to add any header include paths you need (CocoaTouch ?). > > I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. > > On 21/12/2013, at 1:01 PM, Schell Scivally wrote: > > Carter: Yes, I've followed the instructions on the wiki and updated > Xcode's build settings. > Maxwell: When I try it errors with: > > arm-apple-darwin10-ghc Main.hs -o Main.a > > Main.hs:5:8: > > Could not find module 'IOS.Touch' > > Use -v to see a list of the files searched for. > > > And then following it down the rabbit hole: > > arm-apple-darwin10-ghc Main.hs -o Main.a -v > > Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC > version 7.6.3 > > Using binary package database: > /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache > > wired-in package ghc-prim mapped to > ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 > > wired-in package integer-simple mapped to > integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff > > wired-in package base mapped to > base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 > > wired-in package rts mapped to builtin_rts > > wired-in package template-haskell mapped to > template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba > > wired-in package dph-seq not found. > > wired-in package dph-par not found. > > Hsc static flags: > > wired-in package ghc-prim mapped to > ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 > > wired-in package integer-simple mapped to > integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff > > wired-in package base mapped to > base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 > > wired-in package rts mapped to builtin_rts > > wired-in package template-haskell mapped to > template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba > > wired-in package dph-seq not found. > > wired-in package dph-par not found. > > *** Chasing dependencies: > > Chasing modules from: *Main.hs > > > Main.hs:5:8: > > Could not find module 'IOS.Touch' > > Locations searched: > > IOS/Touch.hs > > IOS/Touch.lhs > > *** Deleting temp files: > > Deleting: > > *** Deleting temp dirs: > > Deleting: > > > So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of > the reasons I'm trying to use cabal, since it seems to be pretty good at > running hsc2hs on that file automagically. Though ghc is supposed to work > with .hsc, no? > > If I try to compile Touch.hsc by itself I get something interesting: > > arm-apple-darwin10-ghc IOS/Touch.hsc > > ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported > file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 > 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): > IOS/Touch.hsc > > Undefined symbols for architecture armv7: > > "_ZCMain_main_closure", referenced from: > > _main in ghc85846_2.o > > ld: symbol(s) not found for architecture armv7 > > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported > file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 > 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): > IOS/Touch.hsc > > Undefined symbols for architecture armv7s: > > "_ZCMain_main_closure", referenced from: > > _main in ghc85846_2.o > > ld: symbol(s) not found for architecture armv7s > > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: > can't open input file: a-armv7.o (No such file or directory) > > rm: a-armv7.o: No such file or directory > > rm: a-armv7s.o: No such file or directory > > > On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > >> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >> >> Also I'm not sure why you have a Main.a as well. You should link the >> Blocks.a in Xcode. You shouldn't need two .a's. >> >> __END__ Maxwell Swadling >> >> On 21 Dec 2013, at 12:43 pm, Carter Schonwald >> wrote: >> >> Aren't there some settings that need to be manipulated in Xcode? Like >> "don't run strip. Just don't"? Are you doing that stuff? >> >> On Friday, December 20, 2013, Schell Scivally wrote: >> >>> Sorry in the last message I meant "(with the list of _warnings_ >>> mentioned on the wiki)". >>> >>> >>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally wrote: >>> >>> I'll sum up the process I'm going through. I `cd` into Blocks where >>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>> --config-file=path/to/arm/config build`. The config file was created by >>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>> different ways depending on the `ghc-options` field in the Blocks.cabal >>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>> outputs - as it isn't specified): >>> >>> Resolving dependencies... >>> >>> Configuring Blocks-0.1.0.0... >>> >>> Building Blocks-0.1.0.0... >>> >>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>> >>> Linking dist-arm/build/Blocks/Blocks.a ... >>> >>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>> can't locate file for: -lpthread >>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>> file: -lpthread is not an object file (not allowed in a library) >>> >>> With ghc-options: -staticlib it looks like the build completes (with the >>> list of errors mentioned on the wiki). I then have two libs, src/Main.a and >>> dist-arm/build/Blocks/Blocks.a >>> >>> I then add either Blocks.a or Main.a to my project (or both, which I've >>> also tried). Then I build for my device with command-b. Both static libs >>> are ignored for each architecture and then clang ends in a linker error. >>> Here is the build log from Xcode: http://lpaste.net/97304 and my setup: >>> https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: >>> https://github.com/schell/blocks-ios/ >>> >>> Please let me know if you need more information. >>> >>> >>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally wrote: >>> >>> Currently I'm using `arm-apple-darwin10-cabal >>> --config-file=path/to/my/arm/config build >>> >>> The cabal file and the rest of the source can be found at >>> https://github.com/schell/blocks-ios/ >>> >>> I'm following the directions at >>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >>> much as possible but I don't really know how to use ghc to build all the >>> files in a project (when I try it can't find the IOS.Touch module), which >>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>> me if I'm making some obvious mistake. >>> >>> >>> >>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>> maxwellswadling at gmail.com> wrote: >>> >>> How are you compiling the static library? What command are you using? >>> >>> __END__ >>> Maxwell Swadling >>> >>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>> wrote: >>> >>> Carter pointed out I only mentioned the warning. ld spits out a warning >>> and then the build fails in the linking phase because the static lib was >>> ignored and not linked, making the main() provided by the lib undefined: >>> >>> ld: warning: ignoring file >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>> was built for archive which is not the architecture being linked (armv7): >>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>> >>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>> >>> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxwellswadling at gmail.com Sat Dec 21 04:11:05 2013 From: maxwellswadling at gmail.com (Maxwell Swadling) Date: Sat, 21 Dec 2013 15:11:05 +1100 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: were you using cabal sandbox? If so, delete the cabal sandbox and cabal install the dependencies (vector in this case is missing). On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally wrote: > Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next error > is: > > arm-apple-darwin10-ghc -staticlib Main.hs -threaded > > IOS/Touch.hsc:6:8: > > Could not find module 'Data.Vector.Storable' > > Use -v to see a list of the files searched for. > > > Is there a way for me to manually include the Data.Vector.Storable package? > > > On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > >> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of >> the reasons I'm trying to use cabal, since it seems to be pretty good at >> running hsc2hs on that file automagically. Though ghc is supposed to work >> with .hsc, no? >> >> If I try to compile Touch.hsc by itself I get something interesting: >> >> arm-apple-darwin10-ghc IOS/Touch.hsc >> >> GHC doesn't! >> >> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >> produce `IOS/Touch/Touch.hs`. >> >> You will have to add any header include paths you need (CocoaTouch ?). >> >> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >> >> On 21/12/2013, at 1:01 PM, Schell Scivally wrote: >> >> Carter: Yes, I've followed the instructions on the wiki and updated >> Xcode's build settings. >> Maxwell: When I try it errors with: >> >> arm-apple-darwin10-ghc Main.hs -o Main.a >> >> Main.hs:5:8: >> >> Could not find module 'IOS.Touch' >> >> Use -v to see a list of the files searched for. >> >> >> And then following it down the rabbit hole: >> >> arm-apple-darwin10-ghc Main.hs -o Main.a -v >> >> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC >> version 7.6.3 >> >> Using binary package database: >> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >> >> wired-in package ghc-prim mapped to >> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >> >> wired-in package integer-simple mapped to >> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >> >> wired-in package base mapped to >> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >> >> wired-in package rts mapped to builtin_rts >> >> wired-in package template-haskell mapped to >> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >> >> wired-in package dph-seq not found. >> >> wired-in package dph-par not found. >> >> Hsc static flags: >> >> wired-in package ghc-prim mapped to >> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >> >> wired-in package integer-simple mapped to >> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >> >> wired-in package base mapped to >> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >> >> wired-in package rts mapped to builtin_rts >> >> wired-in package template-haskell mapped to >> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >> >> wired-in package dph-seq not found. >> >> wired-in package dph-par not found. >> >> *** Chasing dependencies: >> >> Chasing modules from: *Main.hs >> >> >> Main.hs:5:8: >> >> Could not find module 'IOS.Touch' >> >> Locations searched: >> >> IOS/Touch.hs >> >> IOS/Touch.lhs >> >> *** Deleting temp files: >> >> Deleting: >> >> *** Deleting temp dirs: >> >> Deleting: >> >> >> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of >> the reasons I'm trying to use cabal, since it seems to be pretty good at >> running hsc2hs on that file automagically. Though ghc is supposed to work >> with .hsc, no? >> >> If I try to compile Touch.hsc by itself I get something interesting: >> >> arm-apple-darwin10-ghc IOS/Touch.hsc >> >> ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported >> file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 >> 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): >> IOS/Touch.hsc >> >> Undefined symbols for architecture armv7: >> >> "_ZCMain_main_closure", referenced from: >> >> _main in ghc85846_2.o >> >> ld: symbol(s) not found for architecture armv7 >> >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> >> ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported >> file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 >> 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): >> IOS/Touch.hsc >> >> Undefined symbols for architecture armv7s: >> >> "_ZCMain_main_closure", referenced from: >> >> _main in ghc85846_2.o >> >> ld: symbol(s) not found for architecture armv7s >> >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >> can't open input file: a-armv7.o (No such file or directory) >> >> rm: a-armv7.o: No such file or directory >> >> rm: a-armv7s.o: No such file or directory >> >> >> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>> >>> Also I'm not sure why you have a Main.a as well. You should link the >>> Blocks.a in Xcode. You shouldn't need two .a's. >>> >>> __END__ Maxwell Swadling >>> >>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>> carter.schonwald at gmail.com> wrote: >>> >>> Aren't there some settings that need to be manipulated in Xcode? Like >>> "don't run strip. Just don't"? Are you doing that stuff? >>> >>> On Friday, December 20, 2013, Schell Scivally wrote: >>> >>>> Sorry in the last message I meant "(with the list of _warnings_ >>>> mentioned on the wiki)". >>>> >>>> >>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally >>> > wrote: >>>> >>>> I'll sum up the process I'm going through. I `cd` into Blocks where >>>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>> --config-file=path/to/arm/config build`. The config file was created by >>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>> outputs - as it isn't specified): >>>> >>>> Resolving dependencies... >>>> >>>> Configuring Blocks-0.1.0.0... >>>> >>>> Building Blocks-0.1.0.0... >>>> >>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>> >>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>> >>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>> can't locate file for: -lpthread >>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>> file: -lpthread is not an object file (not allowed in a library) >>>> >>>> With ghc-options: -staticlib it looks like the build completes (with >>>> the list of errors mentioned on the wiki). I then have two libs, src/Main.a >>>> and dist-arm/build/Blocks/Blocks.a >>>> >>>> I then add either Blocks.a or Main.a to my project (or both, which I've >>>> also tried). Then I build for my device with command-b. Both static libs >>>> are ignored for each architecture and then clang ends in a linker error. >>>> Here is the build log from Xcode: http://lpaste.net/97304 and my >>>> setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the >>>> source: https://github.com/schell/blocks-ios/ >>>> >>>> Please let me know if you need more information. >>>> >>>> >>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally >>> > wrote: >>>> >>>> Currently I'm using `arm-apple-darwin10-cabal >>>> --config-file=path/to/my/arm/config build >>>> >>>> The cabal file and the rest of the source can be found at >>>> https://github.com/schell/blocks-ios/ >>>> >>>> I'm following the directions at >>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >>>> much as possible but I don't really know how to use ghc to build all the >>>> files in a project (when I try it can't find the IOS.Touch module), which >>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>> me if I'm making some obvious mistake. >>>> >>>> >>>> >>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>> maxwellswadling at gmail.com> wrote: >>>> >>>> How are you compiling the static library? What command are you using? >>>> >>>> __END__ >>>> Maxwell Swadling >>>> >>>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>>> wrote: >>>> >>>> Carter pointed out I only mentioned the warning. ld spits out a warning >>>> and then the build fails in the linking phase because the static lib was >>>> ignored and not linked, making the main() provided by the lib undefined: >>>> >>>> ld: warning: ignoring file >>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>> was built for archive which is not the architecture being linked (armv7): >>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>> >>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>> >>>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -- Maxwell Swadling -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 04:15:42 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 20:15:42 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: No, I'm not - I'm using arm-apple-darwin10-cabal --config-file=path/to/arm.config install vector, which yields: Resolving dependencies... All the requested packages are already installed: vector-0.10.9.1 Use --reinstall if you want to reinstall anyway. Though it doesn't look like it's actually installed: arm-apple-darwin10-ghc-pkg list /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d Cabal-1.18.1.2 array-0.5.0.0 base-4.7.0.0 bin-package-db-0.0.0.0 binary-0.7.1.0 bytestring-0.10.4.0 containers-0.5.3.1 deepseq-1.3.0.2 directory-1.2.0.2 filepath-1.3.0.2 ghc-prim-0.3.1.0 hoopl-3.10.0.0 hpc-0.6.0.1 integer-simple-0.1.1.0 old-locale-1.0.0.6 pretty-1.1.1.1 process-1.2.0.0 rts-1.0 template-haskell-2.9.0.0 time-1.4.1 transformers-0.3.0.0 unix-2.7.0.0 If I don't include my arm.config file I get this: arm-apple-darwin10-cabal install vector Resolving dependencies... Configuring primitive-0.5.1.0... Failed to install primitive-0.5.1.0 Last 10 lines of the build log ( /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): cabal: Error: some packages failed to install: primitive-0.5.1.0 failed during the configure step. The exception was: ExitFailure 127 vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling wrote: > were you using cabal sandbox? If so, delete the cabal sandbox and cabal > install the dependencies (vector in this case is missing). > > > On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally wrote: > >> Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next error >> is: >> >> arm-apple-darwin10-ghc -staticlib Main.hs -threaded >> >> IOS/Touch.hsc:6:8: >> >> Could not find module 'Data.Vector.Storable' >> >> Use -v to see a list of the files searched for. >> >> >> Is there a way for me to manually include the Data.Vector.Storable >> package? >> >> >> On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of >>> the reasons I'm trying to use cabal, since it seems to be pretty good at >>> running hsc2hs on that file automagically. Though ghc is supposed to work >>> with .hsc, no? >>> >>> If I try to compile Touch.hsc by itself I get something interesting: >>> >>> arm-apple-darwin10-ghc IOS/Touch.hsc >>> >>> GHC doesn't! >>> >>> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >>> produce `IOS/Touch/Touch.hs`. >>> >>> You will have to add any header include paths you need (CocoaTouch ?). >>> >>> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >>> >>> On 21/12/2013, at 1:01 PM, Schell Scivally >>> wrote: >>> >>> Carter: Yes, I've followed the instructions on the wiki and updated >>> Xcode's build settings. >>> Maxwell: When I try it errors with: >>> >>> arm-apple-darwin10-ghc Main.hs -o Main.a >>> >>> Main.hs:5:8: >>> >>> Could not find module 'IOS.Touch' >>> >>> Use -v to see a list of the files searched for. >>> >>> >>> And then following it down the rabbit hole: >>> >>> arm-apple-darwin10-ghc Main.hs -o Main.a -v >>> >>> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC >>> version 7.6.3 >>> >>> Using binary package database: >>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >>> >>> wired-in package ghc-prim mapped to >>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>> >>> wired-in package integer-simple mapped to >>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>> >>> wired-in package base mapped to >>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>> >>> wired-in package rts mapped to builtin_rts >>> >>> wired-in package template-haskell mapped to >>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>> >>> wired-in package dph-seq not found. >>> >>> wired-in package dph-par not found. >>> >>> Hsc static flags: >>> >>> wired-in package ghc-prim mapped to >>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>> >>> wired-in package integer-simple mapped to >>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>> >>> wired-in package base mapped to >>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>> >>> wired-in package rts mapped to builtin_rts >>> >>> wired-in package template-haskell mapped to >>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>> >>> wired-in package dph-seq not found. >>> >>> wired-in package dph-par not found. >>> >>> *** Chasing dependencies: >>> >>> Chasing modules from: *Main.hs >>> >>> >>> Main.hs:5:8: >>> >>> Could not find module 'IOS.Touch' >>> >>> Locations searched: >>> >>> IOS/Touch.hs >>> >>> IOS/Touch.lhs >>> >>> *** Deleting temp files: >>> >>> Deleting: >>> >>> *** Deleting temp dirs: >>> >>> Deleting: >>> >>> >>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one of >>> the reasons I'm trying to use cabal, since it seems to be pretty good at >>> running hsc2hs on that file automagically. Though ghc is supposed to work >>> with .hsc, no? >>> >>> If I try to compile Touch.hsc by itself I get something interesting: >>> >>> arm-apple-darwin10-ghc IOS/Touch.hsc >>> >>> ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported >>> file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 >>> 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7): >>> IOS/Touch.hsc >>> >>> Undefined symbols for architecture armv7: >>> >>> "_ZCMain_main_closure", referenced from: >>> >>> _main in ghc85846_2.o >>> >>> ld: symbol(s) not found for architecture armv7 >>> >>> clang: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> >>> ld: warning: ignoring file IOS/Touch.hsc, file was built for unsupported >>> file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 0x47 0x45 >>> 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked (armv7s): >>> IOS/Touch.hsc >>> >>> Undefined symbols for architecture armv7s: >>> >>> "_ZCMain_main_closure", referenced from: >>> >>> _main in ghc85846_2.o >>> >>> ld: symbol(s) not found for architecture armv7s >>> >>> clang: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> >>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >>> can't open input file: a-armv7.o (No such file or directory) >>> >>> rm: a-armv7.o: No such file or directory >>> >>> rm: a-armv7s.o: No such file or directory >>> >>> >>> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >>> maxwellswadling at gmail.com> wrote: >>> >>>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>>> >>>> Also I'm not sure why you have a Main.a as well. You should link the >>>> Blocks.a in Xcode. You shouldn't need two .a's. >>>> >>>> __END__ Maxwell Swadling >>>> >>>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>>> carter.schonwald at gmail.com> wrote: >>>> >>>> Aren't there some settings that need to be manipulated in Xcode? Like >>>> "don't run strip. Just don't"? Are you doing that stuff? >>>> >>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>> >>>>> Sorry in the last message I meant "(with the list of _warnings_ >>>>> mentioned on the wiki)". >>>>> >>>>> >>>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally < >>>>> efsubenovex at gmail.com> wrote: >>>>> >>>>> I'll sum up the process I'm going through. I `cd` into Blocks where >>>>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>>> --config-file=path/to/arm/config build`. The config file was created by >>>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>>> outputs - as it isn't specified): >>>>> >>>>> Resolving dependencies... >>>>> >>>>> Configuring Blocks-0.1.0.0... >>>>> >>>>> Building Blocks-0.1.0.0... >>>>> >>>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>>> >>>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>>> >>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>> can't locate file for: -lpthread >>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>> file: -lpthread is not an object file (not allowed in a library) >>>>> >>>>> With ghc-options: -staticlib it looks like the build completes (with >>>>> the list of errors mentioned on the wiki). I then have two libs, src/Main.a >>>>> and dist-arm/build/Blocks/Blocks.a >>>>> >>>>> I then add either Blocks.a or Main.a to my project (or both, which >>>>> I've also tried). Then I build for my device with command-b. Both static >>>>> libs are ignored for each architecture and then clang ends in a linker >>>>> error. Here is the build log from Xcode: http://lpaste.net/97304 and >>>>> my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and the >>>>> source: https://github.com/schell/blocks-ios/ >>>>> >>>>> Please let me know if you need more information. >>>>> >>>>> >>>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally < >>>>> efsubenovex at gmail.com> wrote: >>>>> >>>>> Currently I'm using `arm-apple-darwin10-cabal >>>>> --config-file=path/to/my/arm/config build >>>>> >>>>> The cabal file and the rest of the source can be found at >>>>> https://github.com/schell/blocks-ios/ >>>>> >>>>> I'm following the directions at >>>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >>>>> much as possible but I don't really know how to use ghc to build all the >>>>> files in a project (when I try it can't find the IOS.Touch module), which >>>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>>> me if I'm making some obvious mistake. >>>>> >>>>> >>>>> >>>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>>> maxwellswadling at gmail.com> wrote: >>>>> >>>>> How are you compiling the static library? What command are you using? >>>>> >>>>> __END__ >>>>> Maxwell Swadling >>>>> >>>>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>>>> wrote: >>>>> >>>>> Carter pointed out I only mentioned the warning. ld spits out a >>>>> warning and then the build fails in the linking phase because the static >>>>> lib was ignored and not linked, making the main() provided by the lib >>>>> undefined: >>>>> >>>>> ld: warning: ignoring file >>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>> was built for archive which is not the architecture being linked (armv7): >>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>> >>>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>>> >>>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > > > > -- > Maxwell Swadling > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxwellswadling at gmail.com Sat Dec 21 04:23:09 2013 From: maxwellswadling at gmail.com (Maxwell Swadling) Date: Sat, 21 Dec 2013 15:23:09 +1100 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: I think you need to set your "--package-db" option when using ghc-pkg the subsequently ghc. The value should be in the cabal config file. Can you post your cabal config? On Sat, Dec 21, 2013 at 3:15 PM, Schell Scivally wrote: > No, I'm not - I'm using arm-apple-darwin10-cabal > --config-file=path/to/arm.config install vector, which yields: > > Resolving dependencies... > > All the requested packages are already installed: > > vector-0.10.9.1 > > Use --reinstall if you want to reinstall anyway. > > Though it doesn't look like it's actually installed: > > arm-apple-darwin10-ghc-pkg list > > /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d > > Cabal-1.18.1.2 > > array-0.5.0.0 > > base-4.7.0.0 > > bin-package-db-0.0.0.0 > > binary-0.7.1.0 > > bytestring-0.10.4.0 > > containers-0.5.3.1 > > deepseq-1.3.0.2 > > directory-1.2.0.2 > > filepath-1.3.0.2 > > ghc-prim-0.3.1.0 > > hoopl-3.10.0.0 > > hpc-0.6.0.1 > > integer-simple-0.1.1.0 > > old-locale-1.0.0.6 > > pretty-1.1.1.1 > > process-1.2.0.0 > > rts-1.0 > > template-haskell-2.9.0.0 > > time-1.4.1 > > transformers-0.3.0.0 > > unix-2.7.0.0 > > If I don't include my arm.config file I get this: > > arm-apple-darwin10-cabal install vector > > Resolving dependencies... > > Configuring primitive-0.5.1.0... > > Failed to install primitive-0.5.1.0 > > Last 10 lines of the build log ( > /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): > > cabal: Error: some packages failed to install: > > primitive-0.5.1.0 failed during the configure step. The exception was: > > ExitFailure 127 > > vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install > > > > > On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > >> were you using cabal sandbox? If so, delete the cabal sandbox and cabal >> install the dependencies (vector in this case is missing). >> >> >> On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally wrote: >> >>> Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next error >>> is: >>> >>> arm-apple-darwin10-ghc -staticlib Main.hs -threaded >>> >>> IOS/Touch.hsc:6:8: >>> >>> Could not find module 'Data.Vector.Storable' >>> >>> Use -v to see a list of the files searched for. >>> >>> >>> Is there a way for me to manually include the Data.Vector.Storable >>> package? >>> >>> >>> On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < >>> maxwellswadling at gmail.com> wrote: >>> >>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>> with .hsc, no? >>>> >>>> If I try to compile Touch.hsc by itself I get something interesting: >>>> >>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>> >>>> GHC doesn't! >>>> >>>> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >>>> produce `IOS/Touch/Touch.hs`. >>>> >>>> You will have to add any header include paths you need (CocoaTouch ?). >>>> >>>> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >>>> >>>> On 21/12/2013, at 1:01 PM, Schell Scivally >>>> wrote: >>>> >>>> Carter: Yes, I've followed the instructions on the wiki and updated >>>> Xcode's build settings. >>>> Maxwell: When I try it errors with: >>>> >>>> arm-apple-darwin10-ghc Main.hs -o Main.a >>>> >>>> Main.hs:5:8: >>>> >>>> Could not find module 'IOS.Touch' >>>> >>>> Use -v to see a list of the files searched for. >>>> >>>> >>>> And then following it down the rabbit hole: >>>> >>>> arm-apple-darwin10-ghc Main.hs -o Main.a -v >>>> >>>> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC >>>> version 7.6.3 >>>> >>>> Using binary package database: >>>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >>>> >>>> wired-in package ghc-prim mapped to >>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>> >>>> wired-in package integer-simple mapped to >>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>> >>>> wired-in package base mapped to >>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>> >>>> wired-in package rts mapped to builtin_rts >>>> >>>> wired-in package template-haskell mapped to >>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>> >>>> wired-in package dph-seq not found. >>>> >>>> wired-in package dph-par not found. >>>> >>>> Hsc static flags: >>>> >>>> wired-in package ghc-prim mapped to >>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>> >>>> wired-in package integer-simple mapped to >>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>> >>>> wired-in package base mapped to >>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>> >>>> wired-in package rts mapped to builtin_rts >>>> >>>> wired-in package template-haskell mapped to >>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>> >>>> wired-in package dph-seq not found. >>>> >>>> wired-in package dph-par not found. >>>> >>>> *** Chasing dependencies: >>>> >>>> Chasing modules from: *Main.hs >>>> >>>> >>>> Main.hs:5:8: >>>> >>>> Could not find module 'IOS.Touch' >>>> >>>> Locations searched: >>>> >>>> IOS/Touch.hs >>>> >>>> IOS/Touch.lhs >>>> >>>> *** Deleting temp files: >>>> >>>> Deleting: >>>> >>>> *** Deleting temp dirs: >>>> >>>> Deleting: >>>> >>>> >>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>> with .hsc, no? >>>> >>>> If I try to compile Touch.hsc by itself I get something interesting: >>>> >>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>> >>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>> (armv7): IOS/Touch.hsc >>>> >>>> Undefined symbols for architecture armv7: >>>> >>>> "_ZCMain_main_closure", referenced from: >>>> >>>> _main in ghc85846_2.o >>>> >>>> ld: symbol(s) not found for architecture armv7 >>>> >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> >>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>> (armv7s): IOS/Touch.hsc >>>> >>>> Undefined symbols for architecture armv7s: >>>> >>>> "_ZCMain_main_closure", referenced from: >>>> >>>> _main in ghc85846_2.o >>>> >>>> ld: symbol(s) not found for architecture armv7s >>>> >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> >>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >>>> can't open input file: a-armv7.o (No such file or directory) >>>> >>>> rm: a-armv7.o: No such file or directory >>>> >>>> rm: a-armv7s.o: No such file or directory >>>> >>>> >>>> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >>>> maxwellswadling at gmail.com> wrote: >>>> >>>>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>>>> >>>>> Also I'm not sure why you have a Main.a as well. You should link the >>>>> Blocks.a in Xcode. You shouldn't need two .a's. >>>>> >>>>> __END__ Maxwell Swadling >>>>> >>>>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>>>> carter.schonwald at gmail.com> wrote: >>>>> >>>>> Aren't there some settings that need to be manipulated in Xcode? Like >>>>> "don't run strip. Just don't"? Are you doing that stuff? >>>>> >>>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>>> >>>>>> Sorry in the last message I meant "(with the list of _warnings_ >>>>>> mentioned on the wiki)". >>>>>> >>>>>> >>>>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally < >>>>>> efsubenovex at gmail.com> wrote: >>>>>> >>>>>> I'll sum up the process I'm going through. I `cd` into Blocks where >>>>>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>>>> --config-file=path/to/arm/config build`. The config file was created by >>>>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>>>> outputs - as it isn't specified): >>>>>> >>>>>> Resolving dependencies... >>>>>> >>>>>> Configuring Blocks-0.1.0.0... >>>>>> >>>>>> Building Blocks-0.1.0.0... >>>>>> >>>>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>>>> >>>>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>>>> >>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>> can't locate file for: -lpthread >>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>> file: -lpthread is not an object file (not allowed in a library) >>>>>> >>>>>> With ghc-options: -staticlib it looks like the build completes (with >>>>>> the list of errors mentioned on the wiki). I then have two libs, src/Main.a >>>>>> and dist-arm/build/Blocks/Blocks.a >>>>>> >>>>>> I then add either Blocks.a or Main.a to my project (or both, which >>>>>> I've also tried). Then I build for my device with command-b. Both static >>>>>> libs are ignored for each architecture and then clang ends in a linker >>>>>> error. Here is the build log from Xcode: http://lpaste.net/97304 and >>>>>> my setup: https://gist.github.com/schell/f3a737171ce2f6b1119c and >>>>>> the source: https://github.com/schell/blocks-ios/ >>>>>> >>>>>> Please let me know if you need more information. >>>>>> >>>>>> >>>>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally < >>>>>> efsubenovex at gmail.com> wrote: >>>>>> >>>>>> Currently I'm using `arm-apple-darwin10-cabal >>>>>> --config-file=path/to/my/arm/config build >>>>>> >>>>>> The cabal file and the rest of the source can be found at >>>>>> https://github.com/schell/blocks-ios/ >>>>>> >>>>>> I'm following the directions at >>>>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS as >>>>>> much as possible but I don't really know how to use ghc to build all the >>>>>> files in a project (when I try it can't find the IOS.Touch module), which >>>>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>>>> me if I'm making some obvious mistake. >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>>>> maxwellswadling at gmail.com> wrote: >>>>>> >>>>>> How are you compiling the static library? What command are you using? >>>>>> >>>>>> __END__ >>>>>> Maxwell Swadling >>>>>> >>>>>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>>>>> wrote: >>>>>> >>>>>> Carter pointed out I only mentioned the warning. ld spits out a >>>>>> warning and then the build fails in the linking phase because the static >>>>>> lib was ignored and not linked, making the main() provided by the lib >>>>>> undefined: >>>>>> >>>>>> ld: warning: ignoring file >>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>>> was built for archive which is not the architecture being linked (armv7): >>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>>> >>>>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>>>> >>>>>> >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>>> >>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> >> >> >> -- >> Maxwell Swadling >> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -- Maxwell Swadling -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Dec 21 06:22:55 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Fri, 20 Dec 2013 22:22:55 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: My cabal config is a vanilla config file generated by arm-apple-darwin10-cabal: http://lpaste.net/97322 On Fri, Dec 20, 2013 at 8:23 PM, Maxwell Swadling wrote: > I think you need to set your "--package-db" option when using ghc-pkg the > subsequently ghc. > > The value should be in the cabal config file. > > Can you post your cabal config? > > > > On Sat, Dec 21, 2013 at 3:15 PM, Schell Scivally wrote: > >> No, I'm not - I'm using arm-apple-darwin10-cabal >> --config-file=path/to/arm.config install vector, which yields: >> >> Resolving dependencies... >> >> All the requested packages are already installed: >> >> vector-0.10.9.1 >> >> Use --reinstall if you want to reinstall anyway. >> >> Though it doesn't look like it's actually installed: >> >> arm-apple-darwin10-ghc-pkg list >> >> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d >> >> Cabal-1.18.1.2 >> >> array-0.5.0.0 >> >> base-4.7.0.0 >> >> bin-package-db-0.0.0.0 >> >> binary-0.7.1.0 >> >> bytestring-0.10.4.0 >> >> containers-0.5.3.1 >> >> deepseq-1.3.0.2 >> >> directory-1.2.0.2 >> >> filepath-1.3.0.2 >> >> ghc-prim-0.3.1.0 >> >> hoopl-3.10.0.0 >> >> hpc-0.6.0.1 >> >> integer-simple-0.1.1.0 >> >> old-locale-1.0.0.6 >> >> pretty-1.1.1.1 >> >> process-1.2.0.0 >> >> rts-1.0 >> >> template-haskell-2.9.0.0 >> >> time-1.4.1 >> >> transformers-0.3.0.0 >> >> unix-2.7.0.0 >> >> If I don't include my arm.config file I get this: >> >> arm-apple-darwin10-cabal install vector >> >> Resolving dependencies... >> >> Configuring primitive-0.5.1.0... >> >> Failed to install primitive-0.5.1.0 >> >> Last 10 lines of the build log ( >> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >> >> cabal: Error: some packages failed to install: >> >> primitive-0.5.1.0 failed during the configure step. The exception was: >> >> ExitFailure 127 >> >> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install >> >> >> >> >> On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >>> were you using cabal sandbox? If so, delete the cabal sandbox and cabal >>> install the dependencies (vector in this case is missing). >>> >>> >>> On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally wrote: >>> >>>> Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next >>>> error is: >>>> >>>> arm-apple-darwin10-ghc -staticlib Main.hs -threaded >>>> >>>> IOS/Touch.hsc:6:8: >>>> >>>> Could not find module 'Data.Vector.Storable' >>>> >>>> Use -v to see a list of the files searched for. >>>> >>>> >>>> Is there a way for me to manually include the Data.Vector.Storable >>>> package? >>>> >>>> >>>> On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < >>>> maxwellswadling at gmail.com> wrote: >>>> >>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>>> with .hsc, no? >>>>> >>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>> >>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>> >>>>> GHC doesn't! >>>>> >>>>> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >>>>> produce `IOS/Touch/Touch.hs`. >>>>> >>>>> You will have to add any header include paths you need (CocoaTouch ?). >>>>> >>>>> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >>>>> >>>>> On 21/12/2013, at 1:01 PM, Schell Scivally >>>>> wrote: >>>>> >>>>> Carter: Yes, I've followed the instructions on the wiki and updated >>>>> Xcode's build settings. >>>>> Maxwell: When I try it errors with: >>>>> >>>>> arm-apple-darwin10-ghc Main.hs -o Main.a >>>>> >>>>> Main.hs:5:8: >>>>> >>>>> Could not find module 'IOS.Touch' >>>>> >>>>> Use -v to see a list of the files searched for. >>>>> >>>>> >>>>> And then following it down the rabbit hole: >>>>> >>>>> arm-apple-darwin10-ghc Main.hs -o Main.a -v >>>>> >>>>> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC >>>>> version 7.6.3 >>>>> >>>>> Using binary package database: >>>>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >>>>> >>>>> wired-in package ghc-prim mapped to >>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>> >>>>> wired-in package integer-simple mapped to >>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>> >>>>> wired-in package base mapped to >>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>> >>>>> wired-in package rts mapped to builtin_rts >>>>> >>>>> wired-in package template-haskell mapped to >>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>> >>>>> wired-in package dph-seq not found. >>>>> >>>>> wired-in package dph-par not found. >>>>> >>>>> Hsc static flags: >>>>> >>>>> wired-in package ghc-prim mapped to >>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>> >>>>> wired-in package integer-simple mapped to >>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>> >>>>> wired-in package base mapped to >>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>> >>>>> wired-in package rts mapped to builtin_rts >>>>> >>>>> wired-in package template-haskell mapped to >>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>> >>>>> wired-in package dph-seq not found. >>>>> >>>>> wired-in package dph-par not found. >>>>> >>>>> *** Chasing dependencies: >>>>> >>>>> Chasing modules from: *Main.hs >>>>> >>>>> >>>>> Main.hs:5:8: >>>>> >>>>> Could not find module 'IOS.Touch' >>>>> >>>>> Locations searched: >>>>> >>>>> IOS/Touch.hs >>>>> >>>>> IOS/Touch.lhs >>>>> >>>>> *** Deleting temp files: >>>>> >>>>> Deleting: >>>>> >>>>> *** Deleting temp dirs: >>>>> >>>>> Deleting: >>>>> >>>>> >>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>>> with .hsc, no? >>>>> >>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>> >>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>> >>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>> (armv7): IOS/Touch.hsc >>>>> >>>>> Undefined symbols for architecture armv7: >>>>> >>>>> "_ZCMain_main_closure", referenced from: >>>>> >>>>> _main in ghc85846_2.o >>>>> >>>>> ld: symbol(s) not found for architecture armv7 >>>>> >>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>> invocation) >>>>> >>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>> (armv7s): IOS/Touch.hsc >>>>> >>>>> Undefined symbols for architecture armv7s: >>>>> >>>>> "_ZCMain_main_closure", referenced from: >>>>> >>>>> _main in ghc85846_2.o >>>>> >>>>> ld: symbol(s) not found for architecture armv7s >>>>> >>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>> invocation) >>>>> >>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >>>>> can't open input file: a-armv7.o (No such file or directory) >>>>> >>>>> rm: a-armv7.o: No such file or directory >>>>> >>>>> rm: a-armv7s.o: No such file or directory >>>>> >>>>> >>>>> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >>>>> maxwellswadling at gmail.com> wrote: >>>>> >>>>>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>>>>> >>>>>> Also I'm not sure why you have a Main.a as well. You should link the >>>>>> Blocks.a in Xcode. You shouldn't need two .a's. >>>>>> >>>>>> __END__ Maxwell Swadling >>>>>> >>>>>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>>>>> carter.schonwald at gmail.com> wrote: >>>>>> >>>>>> Aren't there some settings that need to be manipulated in Xcode? Like >>>>>> "don't run strip. Just don't"? Are you doing that stuff? >>>>>> >>>>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>>>> >>>>>>> Sorry in the last message I meant "(with the list of _warnings_ >>>>>>> mentioned on the wiki)". >>>>>>> >>>>>>> >>>>>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally < >>>>>>> efsubenovex at gmail.com> wrote: >>>>>>> >>>>>>> I'll sum up the process I'm going through. I `cd` into Blocks where >>>>>>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>>>>> --config-file=path/to/arm/config build`. The config file was created by >>>>>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>>>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>>>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>>>>> outputs - as it isn't specified): >>>>>>> >>>>>>> Resolving dependencies... >>>>>>> >>>>>>> Configuring Blocks-0.1.0.0... >>>>>>> >>>>>>> Building Blocks-0.1.0.0... >>>>>>> >>>>>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>>>>> >>>>>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>>>>> >>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>> can't locate file for: -lpthread >>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>> file: -lpthread is not an object file (not allowed in a library) >>>>>>> >>>>>>> With ghc-options: -staticlib it looks like the build completes (with >>>>>>> the list of errors mentioned on the wiki). I then have two libs, src/Main.a >>>>>>> and dist-arm/build/Blocks/Blocks.a >>>>>>> >>>>>>> I then add either Blocks.a or Main.a to my project (or both, which >>>>>>> I've also tried). Then I build for my device with command-b. Both static >>>>>>> libs are ignored for each architecture and then clang ends in a linker >>>>>>> error. Here is the build log from Xcode: http://lpaste.net/97304and my setup: >>>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c and the source: >>>>>>> https://github.com/schell/blocks-ios/ >>>>>>> >>>>>>> Please let me know if you need more information. >>>>>>> >>>>>>> >>>>>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally < >>>>>>> efsubenovex at gmail.com> wrote: >>>>>>> >>>>>>> Currently I'm using `arm-apple-darwin10-cabal >>>>>>> --config-file=path/to/my/arm/config build >>>>>>> >>>>>>> The cabal file and the rest of the source can be found at >>>>>>> https://github.com/schell/blocks-ios/ >>>>>>> >>>>>>> I'm following the directions at >>>>>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOSas much as possible but I don't really know how to use ghc to build all the >>>>>>> files in a project (when I try it can't find the IOS.Touch module), which >>>>>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>>>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>>>>> me if I'm making some obvious mistake. >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>>>>> maxwellswadling at gmail.com> wrote: >>>>>>> >>>>>>> How are you compiling the static library? What command are you using? >>>>>>> >>>>>>> __END__ >>>>>>> Maxwell Swadling >>>>>>> >>>>>>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>>>>>> wrote: >>>>>>> >>>>>>> Carter pointed out I only mentioned the warning. ld spits out a >>>>>>> warning and then the build fails in the linking phase because the static >>>>>>> lib was ignored and not linked, making the main() provided by the lib >>>>>>> undefined: >>>>>>> >>>>>>> ld: warning: ignoring file >>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>>>> was built for archive which is not the architecture being linked (armv7): >>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>>>> >>>>>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>>>>> >>>>>>> >>>>> >>>>> >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> >>> >>> >>> -- >>> Maxwell Swadling >>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > > > > -- > Maxwell Swadling > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sun Dec 22 17:56:51 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sun, 22 Dec 2013 09:56:51 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble Message-ID: Hey guys, I thought I had fixed my issues by rebuilding HEAD but it looks like I just went in a circle and now I'm back at the same problem from my first message: http://www.haskell.org/pipermail/iphone/2013-December/000345.html I'm trying to cabal install vector but it's failing while installing primitive. The log file shows no error, so it looks like it's silently erring. My setup is here: https://gist.github.com/schell/f3a737171ce2f6b1119c Just for posterity I'll post the output from `arm-apple-darwin10-cabal install vector`: Resolving dependencies... Configuring primitive-0.5.1.0... Failed to install primitive-0.5.1.0 Last 10 lines of the build log ( /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): cabal: Error: some packages failed to install: primitive-0.5.1.0 failed during the configure step. The exception was: ExitFailure 127 vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. The build log is empty. Furthermore, for a while I was trying to use cabal like `arm-apple-darwin10-cabal --config-file=arm.config install vector`, pointing it to a custom cabal file (one that was just autogenerated the first time I issued the command). This looked like it was working, but it says that the package is already installed. If I don't include the --config-file option it errs like above. Using arm-apple-darwin10-ghc to build my project is failing because it can't find Data.Vector.Storable but I can't seem to get cabal to install it in the correct location. -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Dec 22 21:12:19 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 22 Dec 2013 16:12:19 -0500 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Use the -v flag on cabal to get verbose Info. I think the highest is -v 3 or -v4 On Sunday, December 22, 2013, Schell Scivally wrote: > Hey guys, I thought I had fixed my issues by rebuilding HEAD but it looks > like I just went in a circle and now I'm back at the same problem from my > first message: > http://www.haskell.org/pipermail/iphone/2013-December/000345.html > > I'm trying to cabal install vector but it's failing while installing > primitive. The log file shows no error, so it looks like it's silently > erring. My setup is here: > https://gist.github.com/schell/f3a737171ce2f6b1119c > Just for posterity I'll post the output from `arm-apple-darwin10-cabal > install vector`: > > Resolving dependencies... > > Configuring primitive-0.5.1.0... > > Failed to install primitive-0.5.1.0 > > Last 10 lines of the build log ( > /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): > > cabal: Error: some packages failed to install: > > primitive-0.5.1.0 failed during the configure step. The exception was: > > ExitFailure 127 > > vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. > > The build log is empty. > Furthermore, for a while I was trying to use cabal like > `arm-apple-darwin10-cabal --config-file=arm.config install vector`, > pointing it to a custom cabal file (one that was just autogenerated the > first time I issued the command). This looked like it was working, but it > says that the package is already installed. If I don't include the > --config-file option it errs like above. > > Using arm-apple-darwin10-ghc to build my project is failing because it > can't find Data.Vector.Storable but I can't seem to get cabal to install it > in the correct location. > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Dec 22 21:13:01 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 22 Dec 2013 16:13:01 -0500 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: The -v flag is for cabal. Be sure to post a link to the full output. On Sunday, December 22, 2013, Schell Scivally wrote: > Hey guys, I thought I had fixed my issues by rebuilding HEAD but it looks > like I just went in a circle and now I'm back at the same problem from my > first message: > http://www.haskell.org/pipermail/iphone/2013-December/000345.html > > I'm trying to cabal install vector but it's failing while installing > primitive. The log file shows no error, so it looks like it's silently > erring. My setup is here: > https://gist.github.com/schell/f3a737171ce2f6b1119c > Just for posterity I'll post the output from `arm-apple-darwin10-cabal > install vector`: > > Resolving dependencies... > > Configuring primitive-0.5.1.0... > > Failed to install primitive-0.5.1.0 > > Last 10 lines of the build log ( > /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): > > cabal: Error: some packages failed to install: > > primitive-0.5.1.0 failed during the configure step. The exception was: > > ExitFailure 127 > > vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. > > The build log is empty. > Furthermore, for a while I was trying to use cabal like > `arm-apple-darwin10-cabal --config-file=arm.config install vector`, > pointing it to a custom cabal file (one that was just autogenerated the > first time I issued the command). This looked like it was working, but it > says that the package is already installed. If I don't include the > --config-file option it errs like above. > > Using arm-apple-darwin10-ghc to build my project is failing because it > can't find Data.Vector.Storable but I can't seem to get cabal to install it > in the correct location. > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sun Dec 22 22:27:43 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sun, 22 Dec 2013 14:27:43 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Ah, cool - I didn't know that the verbosity arg took a parameter. Here is the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > The -v flag is for cabal. Be sure to post a link to the full output. > > > On Sunday, December 22, 2013, Schell Scivally wrote: > >> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it looks >> like I just went in a circle and now I'm back at the same problem from my >> first message: >> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >> >> I'm trying to cabal install vector but it's failing while installing >> primitive. The log file shows no error, so it looks like it's silently >> erring. My setup is here: >> https://gist.github.com/schell/f3a737171ce2f6b1119c >> Just for posterity I'll post the output from `arm-apple-darwin10-cabal >> install vector`: >> >> Resolving dependencies... >> >> Configuring primitive-0.5.1.0... >> >> Failed to install primitive-0.5.1.0 >> >> Last 10 lines of the build log ( >> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >> >> cabal: Error: some packages failed to install: >> >> primitive-0.5.1.0 failed during the configure step. The exception was: >> >> ExitFailure 127 >> >> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >> >> The build log is empty. >> Furthermore, for a while I was trying to use cabal like >> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >> pointing it to a custom cabal file (one that was just autogenerated the >> first time I issued the command). This looked like it was working, but it >> says that the package is already installed. If I don't include the >> --config-file option it errs like above. >> >> Using arm-apple-darwin10-ghc to build my project is failing because it >> can't find Data.Vector.Storable but I can't seem to get cabal to install it >> in the correct location. >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Dec 22 22:48:18 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 22 Dec 2013 17:48:18 -0500 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Could you also share the primitive log? Seems like something is happening there. Can't you just build primitive by hand then vector? On Sunday, December 22, 2013, Schell Scivally wrote: > Ah, cool - I didn't know that the verbosity arg took a parameter. Here is > the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 > > > On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < > carter.schonwald at gmail.com 'carter.schonwald at gmail.com');>> wrote: > >> The -v flag is for cabal. Be sure to post a link to the full output. >> >> >> On Sunday, December 22, 2013, Schell Scivally wrote: >> >>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>> looks like I just went in a circle and now I'm back at the same problem >>> from my first message: >>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>> >>> I'm trying to cabal install vector but it's failing while installing >>> primitive. The log file shows no error, so it looks like it's silently >>> erring. My setup is here: >>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>> Just for posterity I'll post the output from `arm-apple-darwin10-cabal >>> install vector`: >>> >>> Resolving dependencies... >>> >>> Configuring primitive-0.5.1.0... >>> >>> Failed to install primitive-0.5.1.0 >>> >>> Last 10 lines of the build log ( >>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>> >>> cabal: Error: some packages failed to install: >>> >>> primitive-0.5.1.0 failed during the configure step. The exception was: >>> >>> ExitFailure 127 >>> >>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>> >>> The build log is empty. >>> Furthermore, for a while I was trying to use cabal like >>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>> pointing it to a custom cabal file (one that was just autogenerated the >>> first time I issued the command). This looked like it was working, but it >>> says that the package is already installed. If I don't include the >>> --config-file option it errs like above. >>> >>> Using arm-apple-darwin10-ghc to build my project is failing because it >>> can't find Data.Vector.Storable but I can't seem to get cabal to install it >>> in the correct location. >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Dec 22 22:49:19 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 22 Dec 2013 17:49:19 -0500 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Oooooo. What version of vector are you using? It needs to be the one for ghc HEAD. On Sunday, December 22, 2013, Carter Schonwald wrote: > Could you also share the primitive log? Seems like something is happening > there. > Can't you just build primitive by hand then vector? > > On Sunday, December 22, 2013, Schell Scivally wrote: > >> Ah, cool - I didn't know that the verbosity arg took a parameter. Here is >> the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 >> >> >> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >> carter.schonwald at gmail.com> wrote: >> >>> The -v flag is for cabal. Be sure to post a link to the full output. >>> >>> >>> On Sunday, December 22, 2013, Schell Scivally wrote: >>> >>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>> looks like I just went in a circle and now I'm back at the same problem >>>> from my first message: >>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>> >>>> I'm trying to cabal install vector but it's failing while installing >>>> primitive. The log file shows no error, so it looks like it's silently >>>> erring. My setup is here: >>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>> Just for posterity I'll post the output from `arm-apple-darwin10-cabal >>>> install vector`: >>>> >>>> Resolving dependencies... >>>> >>>> Configuring primitive-0.5.1.0... >>>> >>>> Failed to install primitive-0.5.1.0 >>>> >>>> Last 10 lines of the build log ( >>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>> >>>> cabal: Error: some packages failed to install: >>>> >>>> primitive-0.5.1.0 failed during the configure step. The exception was: >>>> >>>> ExitFailure 127 >>>> >>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>>> >>>> The build log is empty. >>>> Furthermore, for a while I was trying to use cabal like >>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>> pointing it to a custom cabal file (one that was just autogenerated the >>>> first time I issued the command). This looked like it was working, but it >>>> says that the package is already installed. If I don't include the >>>> --config-file option it errs like above. >>>> >>>> Using arm-apple-darwin10-ghc to build my project is failing because it >>>> can't find Data.Vector.Storable but I can't seem to get cabal to install it >>>> in the correct location. >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Mon Dec 23 00:22:55 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sun, 22 Dec 2013 16:22:55 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: The primitive log is empty, nothing is printed to it. The version of vector I'm trying to build is 0.10.9.1, which is currently on hackage. I've also tried building primitive 0.5.2.0 by hand - cloning it from github and then running arm-apple-darwin10-cabal install and it stops at the same error. Nothing is printed to the log file. If I try each step separately (configure, build, install) I can configure fine and building gives this output: Building primitive-0.5.2.0... Preprocessing library primitive-0.5.2.0... [ 1 of 10] Compiling Data.Primitive.Internal.Compat ( Data/Primitive/Internal/Compat.hs, dist-arm/build/Data/Primitive/Internal/Compat.o ) [ 2 of 10] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, dist-arm/build/Data/Primitive/MachDeps.o ) [ 3 of 10] Compiling Data.Primitive.Internal.Operations ( Data/Primitive/Internal/Operations.hs, dist-arm/build/Data/Primitive/Internal/Operations.o ) [ 4 of 10] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist-arm/build/Control/Monad/Primitive.o ) [ 5 of 10] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, dist-arm/build/Data/Primitive/Types.o ) [ 6 of 10] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, dist-arm/build/Data/Primitive/Array.o ) [ 7 of 10] Compiling Data.Primitive.ByteArray ( Data/Primitive/ByteArray.hs, dist-arm/build/Data/Primitive/ByteArray.o ) [ 8 of 10] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, dist-arm/build/Data/Primitive/Addr.o ) [ 9 of 10] Compiling Data.Primitive ( Data/Primitive.hs, dist-arm/build/Data/Primitive.o ) [10 of 10] Compiling Data.Primitive.MutVar ( Data/Primitive/MutVar.hs, dist-arm/build/Data/Primitive/MutVar.o ) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and ar(1) will not be able to operate on it In-place registering primitive-0.5.2.0... And then installing gives: Resolving dependencies... Configuring primitive-0.5.2.0... Failed to install primitive-0.5.2.0 Last 10 lines of the build log ( /Users/schell/.cabal/logs/primitive-0.5.2.0.log ): cabal: Error: some packages failed to install: primitive-0.5.2.0 failed during the configure step. The exception was: ExitFailure 127 To me it seems like the line "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and ar(1) will not be able to operate on it" could be important? Does that sound like it may have something to do with the install failure? On Sun, Dec 22, 2013 at 2:49 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > Oooooo. What version of vector are you using? It needs to be the one > for ghc HEAD. > > > On Sunday, December 22, 2013, Carter Schonwald wrote: > >> Could you also share the primitive log? Seems like something is >> happening there. >> Can't you just build primitive by hand then vector? >> >> On Sunday, December 22, 2013, Schell Scivally wrote: >> >>> Ah, cool - I didn't know that the verbosity arg took a parameter. Here >>> is the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 >>> >>> >>> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >>> carter.schonwald at gmail.com> wrote: >>> >>>> The -v flag is for cabal. Be sure to post a link to the full output. >>>> >>>> >>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>> >>>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>>> looks like I just went in a circle and now I'm back at the same problem >>>>> from my first message: >>>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>>> >>>>> I'm trying to cabal install vector but it's failing while installing >>>>> primitive. The log file shows no error, so it looks like it's silently >>>>> erring. My setup is here: >>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>> Just for posterity I'll post the output from `arm-apple-darwin10-cabal >>>>> install vector`: >>>>> >>>>> Resolving dependencies... >>>>> >>>>> Configuring primitive-0.5.1.0... >>>>> >>>>> Failed to install primitive-0.5.1.0 >>>>> >>>>> Last 10 lines of the build log ( >>>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>>> >>>>> cabal: Error: some packages failed to install: >>>>> >>>>> primitive-0.5.1.0 failed during the configure step. The exception was: >>>>> >>>>> ExitFailure 127 >>>>> >>>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>>>> >>>>> The build log is empty. >>>>> Furthermore, for a while I was trying to use cabal like >>>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>>> pointing it to a custom cabal file (one that was just autogenerated the >>>>> first time I issued the command). This looked like it was working, but it >>>>> says that the package is already installed. If I don't include the >>>>> --config-file option it errs like above. >>>>> >>>>> Using arm-apple-darwin10-ghc to build my project is failing because it >>>>> can't find Data.Vector.Storable but I can't seem to get cabal to install it >>>>> in the correct location. >>>>> >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon Dec 23 00:28:33 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 22 Dec 2013 19:28:33 -0500 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Ummmm. Why aren't you using the version of vector and primitive that ghc is built with. Please use those. Wait. Which arm targets are you building? Only the 32bit arm stuff right? I don't think arm 64 support exists yet. On Sunday, December 22, 2013, Schell Scivally wrote: > The primitive log is empty, nothing is printed to it. The version of > vector I'm trying to build is 0.10.9.1, which is currently on hackage. I've > also tried building primitive 0.5.2.0 by hand - cloning it from github and > then running arm-apple-darwin10-cabal install and it stops at the same > error. Nothing is printed to the log file. If I try each step separately > (configure, build, install) I can configure fine and building gives this > output: > > Building primitive-0.5.2.0... > > Preprocessing library primitive-0.5.2.0... > > [ 1 of 10] Compiling Data.Primitive.Internal.Compat ( > Data/Primitive/Internal/Compat.hs, > dist-arm/build/Data/Primitive/Internal/Compat.o ) > > [ 2 of 10] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, > dist-arm/build/Data/Primitive/MachDeps.o ) > > [ 3 of 10] Compiling Data.Primitive.Internal.Operations ( > Data/Primitive/Internal/Operations.hs, > dist-arm/build/Data/Primitive/Internal/Operations.o ) > > [ 4 of 10] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, > dist-arm/build/Control/Monad/Primitive.o ) > > [ 5 of 10] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, > dist-arm/build/Data/Primitive/Types.o ) > > [ 6 of 10] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, > dist-arm/build/Data/Primitive/Array.o ) > > [ 7 of 10] Compiling Data.Primitive.ByteArray ( > Data/Primitive/ByteArray.hs, dist-arm/build/Data/Primitive/ByteArray.o ) > > [ 8 of 10] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, > dist-arm/build/Data/Primitive/Addr.o ) > > [ 9 of 10] Compiling Data.Primitive ( Data/Primitive.hs, > dist-arm/build/Data/Primitive.o ) > > [10 of 10] Compiling Data.Primitive.MutVar ( Data/Primitive/MutVar.hs, > dist-arm/build/Data/Primitive/MutVar.o ) > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: > archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and > ar(1) will not be able to operate on it > In-place registering primitive-0.5.2.0... > > And then installing gives: > > Resolving dependencies... > > Configuring primitive-0.5.2.0... > > Failed to install primitive-0.5.2.0 > > Last 10 lines of the build log ( > /Users/schell/.cabal/logs/primitive-0.5.2.0.log ): > > cabal: Error: some packages failed to install: > > primitive-0.5.2.0 failed during the configure step. The exception was: > > ExitFailure 127 > > To me it seems like the line > "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: > archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and > ar(1) will not be able to operate on it" could be important? Does that > sound like it may have something to do with the install failure? > > > > On Sun, Dec 22, 2013 at 2:49 PM, Carter Schonwald < > carter.schonwald at gmail.com 'carter.schonwald at gmail.com');>> wrote: > >> Oooooo. What version of vector are you using? It needs to be the one >> for ghc HEAD. >> >> >> On Sunday, December 22, 2013, Carter Schonwald wrote: >> >>> Could you also share the primitive log? Seems like something is >>> happening there. >>> Can't you just build primitive by hand then vector? >>> >>> On Sunday, December 22, 2013, Schell Scivally wrote: >>> >>>> Ah, cool - I didn't know that the verbosity arg took a parameter. Here >>>> is the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 >>>> >>>> >>>> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >>>> carter.schonwald at gmail.com> wrote: >>>> >>>>> The -v flag is for cabal. Be sure to post a link to the full output. >>>>> >>>>> >>>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>>> >>>>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>>>> looks like I just went in a circle and now I'm back at the same problem >>>>>> from my first message: >>>>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>>>> >>>>>> I'm trying to cabal install vector but it's failing while installing >>>>>> primitive. The log file shows no error, so it looks like it's silently >>>>>> erring. My setup is here: >>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>>> Just for posterity I'll post the output from >>>>>> `arm-apple-darwin10-cabal install vector`: >>>>>> >>>>>> Resolving dependencies... >>>>>> >>>>>> Configuring primitive-0.5.1.0... >>>>>> >>>>>> Failed to install primitive-0.5.1.0 >>>>>> >>>>>> Last 10 lines of the build log ( >>>>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>>>> >>>>>> cabal: Error: some packages failed to install: >>>>>> >>>>>> primitive-0.5.1.0 failed during the configure step. The exception was: >>>>>> >>>>>> ExitFailure 127 >>>>>> >>>>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>>>>> >>>>>> The build log is empty. >>>>>> Furthermore, for a while I was trying to use cabal like >>>>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>>>> pointing it to a custom cabal file (one that was just autogenerated the >>>>>> first time I issued the command). This looked like it was working, but it >>>>>> says that the package is already installed. If I don't include the >>>>>> --config-file option it errs like above. >>>>>> >>>>>> Using arm-apple-darwin10-ghc to build my project is failing because >>>>>> it can't find Data.Vector.Storable but I can't seem to get cabal to install >>>>>> it in the correct location. >>>>>> >>>>>> -- >>>>>> Schell Scivally >>>>>> http://blog.efnx.com >>>>>> http://github.com/schell >>>>>> http://twitter.com/schellsan >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Mon Dec 23 00:47:30 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Sun, 22 Dec 2013 16:47:30 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Hey Schell, I think I see the issue ? did you see the note in section 6 of https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS regarding the jobs: $ncpus option in ~/.cabal/config ? If you've got that, nuke it and see if that fixes it. I need to file a bug about that with the Cabal team. I've also been meaning to warn ? I am pretty sure the fat armv7s/armv7 binary approach taken by arm-apple-darwin10-ghc doesn't fully work yet (I was convinced it did when I implemented it, but recent testing with armv7 and armv7s devices show missing symbols for one arch or the other). I haven't had nearly the time to work on it and if anyone's looking for a way to help with GHC iOS that's a great self-contained problem to work on : ). If we can't get that approach to work (intercepting build commands and lipoing things together on the fly), there's always the approach of building one GHC for each armv7 and armv7s, but that's got its own pain points since GHC calls both of those just "arm" internally and you have to do some yucky stuff with directory management :/ (that's what I've done here, and it works at least : )). Hopefully I'll be out of the woods in my primary work soon and able to devote more cycles help in cleaning these things up. Cheers Luke On Sun, Dec 22, 2013 at 4:22 PM, Schell Scivally wrote: > The primitive log is empty, nothing is printed to it. The version of > vector I'm trying to build is 0.10.9.1, which is currently on hackage. I've > also tried building primitive 0.5.2.0 by hand - cloning it from github and > then running arm-apple-darwin10-cabal install and it stops at the same > error. Nothing is printed to the log file. If I try each step separately > (configure, build, install) I can configure fine and building gives this > output: > > Building primitive-0.5.2.0... > > Preprocessing library primitive-0.5.2.0... > > [ 1 of 10] Compiling Data.Primitive.Internal.Compat ( > Data/Primitive/Internal/Compat.hs, > dist-arm/build/Data/Primitive/Internal/Compat.o ) > > [ 2 of 10] Compiling Data.Primitive.MachDeps ( Data/Primitive/MachDeps.hs, > dist-arm/build/Data/Primitive/MachDeps.o ) > > [ 3 of 10] Compiling Data.Primitive.Internal.Operations ( > Data/Primitive/Internal/Operations.hs, > dist-arm/build/Data/Primitive/Internal/Operations.o ) > > [ 4 of 10] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, > dist-arm/build/Control/Monad/Primitive.o ) > > [ 5 of 10] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, > dist-arm/build/Data/Primitive/Types.o ) > > [ 6 of 10] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, > dist-arm/build/Data/Primitive/Array.o ) > > [ 7 of 10] Compiling Data.Primitive.ByteArray ( > Data/Primitive/ByteArray.hs, dist-arm/build/Data/Primitive/ByteArray.o ) > > [ 8 of 10] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, > dist-arm/build/Data/Primitive/Addr.o ) > > [ 9 of 10] Compiling Data.Primitive ( Data/Primitive.hs, > dist-arm/build/Data/Primitive.o ) > > [10 of 10] Compiling Data.Primitive.MutVar ( Data/Primitive/MutVar.hs, > dist-arm/build/Data/Primitive/MutVar.o ) > > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: > archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and > ar(1) will not be able to operate on it > In-place registering primitive-0.5.2.0... > > And then installing gives: > > Resolving dependencies... > > Configuring primitive-0.5.2.0... > > Failed to install primitive-0.5.2.0 > > Last 10 lines of the build log ( > /Users/schell/.cabal/logs/primitive-0.5.2.0.log ): > > cabal: Error: some packages failed to install: > > primitive-0.5.2.0 failed during the configure step. The exception was: > > ExitFailure 127 > > To me it seems like the line > "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: > archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and > ar(1) will not be able to operate on it" could be important? Does that > sound like it may have something to do with the install failure? > > > > On Sun, Dec 22, 2013 at 2:49 PM, Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> Oooooo. What version of vector are you using? It needs to be the one >> for ghc HEAD. >> >> >> On Sunday, December 22, 2013, Carter Schonwald wrote: >> >>> Could you also share the primitive log? Seems like something is >>> happening there. >>> Can't you just build primitive by hand then vector? >>> >>> On Sunday, December 22, 2013, Schell Scivally wrote: >>> >>>> Ah, cool - I didn't know that the verbosity arg took a parameter. Here >>>> is the full output: https://gist.github.com/schell/7c08631f52e1e6f54a39 >>>> >>>> >>>> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >>>> carter.schonwald at gmail.com> wrote: >>>> >>>>> The -v flag is for cabal. Be sure to post a link to the full output. >>>>> >>>>> >>>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>>> >>>>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>>>> looks like I just went in a circle and now I'm back at the same problem >>>>>> from my first message: >>>>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>>>> >>>>>> I'm trying to cabal install vector but it's failing while installing >>>>>> primitive. The log file shows no error, so it looks like it's silently >>>>>> erring. My setup is here: >>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>>> Just for posterity I'll post the output from >>>>>> `arm-apple-darwin10-cabal install vector`: >>>>>> >>>>>> Resolving dependencies... >>>>>> >>>>>> Configuring primitive-0.5.1.0... >>>>>> >>>>>> Failed to install primitive-0.5.1.0 >>>>>> >>>>>> Last 10 lines of the build log ( >>>>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>>>> >>>>>> cabal: Error: some packages failed to install: >>>>>> >>>>>> primitive-0.5.1.0 failed during the configure step. The exception was: >>>>>> >>>>>> ExitFailure 127 >>>>>> >>>>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>>>>> >>>>>> The build log is empty. >>>>>> Furthermore, for a while I was trying to use cabal like >>>>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>>>> pointing it to a custom cabal file (one that was just autogenerated the >>>>>> first time I issued the command). This looked like it was working, but it >>>>>> says that the package is already installed. If I don't include the >>>>>> --config-file option it errs like above. >>>>>> >>>>>> Using arm-apple-darwin10-ghc to build my project is failing because >>>>>> it can't find Data.Vector.Storable but I can't seem to get cabal to install >>>>>> it in the correct location. >>>>>> >>>>>> -- >>>>>> Schell Scivally >>>>>> http://blog.efnx.com >>>>>> http://github.com/schell >>>>>> http://twitter.com/schellsan >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Mon Dec 23 10:01:00 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Mon, 23 Dec 2013 02:01:00 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: Just saw this, and can thus confirm you've indeed got the troublesome "jobs: $ncpus" line in there : ). I'll add some stronger wording to the wiki to make sure people get that removed until it's fixed on cabal's side. I also just discovered your https://github.com/schell/blocks-ios project, that's awesome -- that should be a fantastic demo project to get people started so thanks so much for working on it. Keep emailing if you have more trouble, I'll be sure to help as quickly as I can. Cheers Luke On Fri, Dec 20, 2013 at 10:22 PM, Schell Scivally wrote: > My cabal config is a vanilla config file generated by > arm-apple-darwin10-cabal: http://lpaste.net/97322 > > > On Fri, Dec 20, 2013 at 8:23 PM, Maxwell Swadling < > maxwellswadling at gmail.com> wrote: > >> I think you need to set your "--package-db" option when using ghc-pkg the >> subsequently ghc. >> >> The value should be in the cabal config file. >> >> Can you post your cabal config? >> >> >> >> On Sat, Dec 21, 2013 at 3:15 PM, Schell Scivally wrote: >> >>> No, I'm not - I'm using arm-apple-darwin10-cabal >>> --config-file=path/to/arm.config install vector, which yields: >>> >>> Resolving dependencies... >>> >>> All the requested packages are already installed: >>> >>> vector-0.10.9.1 >>> >>> Use --reinstall if you want to reinstall anyway. >>> >>> Though it doesn't look like it's actually installed: >>> >>> arm-apple-darwin10-ghc-pkg list >>> >>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d >>> >>> Cabal-1.18.1.2 >>> >>> array-0.5.0.0 >>> >>> base-4.7.0.0 >>> >>> bin-package-db-0.0.0.0 >>> >>> binary-0.7.1.0 >>> >>> bytestring-0.10.4.0 >>> >>> containers-0.5.3.1 >>> >>> deepseq-1.3.0.2 >>> >>> directory-1.2.0.2 >>> >>> filepath-1.3.0.2 >>> >>> ghc-prim-0.3.1.0 >>> >>> hoopl-3.10.0.0 >>> >>> hpc-0.6.0.1 >>> >>> integer-simple-0.1.1.0 >>> >>> old-locale-1.0.0.6 >>> >>> pretty-1.1.1.1 >>> >>> process-1.2.0.0 >>> >>> rts-1.0 >>> >>> template-haskell-2.9.0.0 >>> >>> time-1.4.1 >>> >>> transformers-0.3.0.0 >>> >>> unix-2.7.0.0 >>> >>> If I don't include my arm.config file I get this: >>> >>> arm-apple-darwin10-cabal install vector >>> >>> Resolving dependencies... >>> >>> Configuring primitive-0.5.1.0... >>> >>> Failed to install primitive-0.5.1.0 >>> >>> Last 10 lines of the build log ( >>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>> >>> cabal: Error: some packages failed to install: >>> >>> primitive-0.5.1.0 failed during the configure step. The exception was: >>> >>> ExitFailure 127 >>> >>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install >>> >>> >>> >>> >>> On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling < >>> maxwellswadling at gmail.com> wrote: >>> >>>> were you using cabal sandbox? If so, delete the cabal sandbox and cabal >>>> install the dependencies (vector in this case is missing). >>>> >>>> >>>> On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally >>> > wrote: >>>> >>>>> Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next >>>>> error is: >>>>> >>>>> arm-apple-darwin10-ghc -staticlib Main.hs -threaded >>>>> >>>>> IOS/Touch.hsc:6:8: >>>>> >>>>> Could not find module 'Data.Vector.Storable' >>>>> >>>>> Use -v to see a list of the files searched for. >>>>> >>>>> >>>>> Is there a way for me to manually include the Data.Vector.Storable >>>>> package? >>>>> >>>>> >>>>> On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < >>>>> maxwellswadling at gmail.com> wrote: >>>>> >>>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>>>> with .hsc, no? >>>>>> >>>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>>> >>>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>>> >>>>>> GHC doesn't! >>>>>> >>>>>> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >>>>>> produce `IOS/Touch/Touch.hs`. >>>>>> >>>>>> You will have to add any header include paths you need (CocoaTouch ?). >>>>>> >>>>>> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >>>>>> >>>>>> On 21/12/2013, at 1:01 PM, Schell Scivally >>>>>> wrote: >>>>>> >>>>>> Carter: Yes, I've followed the instructions on the wiki and updated >>>>>> Xcode's build settings. >>>>>> Maxwell: When I try it errors with: >>>>>> >>>>>> arm-apple-darwin10-ghc Main.hs -o Main.a >>>>>> >>>>>> Main.hs:5:8: >>>>>> >>>>>> Could not find module 'IOS.Touch' >>>>>> >>>>>> Use -v to see a list of the files searched for. >>>>>> >>>>>> >>>>>> And then following it down the rabbit hole: >>>>>> >>>>>> arm-apple-darwin10-ghc Main.hs -o Main.a -v >>>>>> >>>>>> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by GHC >>>>>> version 7.6.3 >>>>>> >>>>>> Using binary package database: >>>>>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >>>>>> >>>>>> wired-in package ghc-prim mapped to >>>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>>> >>>>>> wired-in package integer-simple mapped to >>>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>>> >>>>>> wired-in package base mapped to >>>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>>> >>>>>> wired-in package rts mapped to builtin_rts >>>>>> >>>>>> wired-in package template-haskell mapped to >>>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>>> >>>>>> wired-in package dph-seq not found. >>>>>> >>>>>> wired-in package dph-par not found. >>>>>> >>>>>> Hsc static flags: >>>>>> >>>>>> wired-in package ghc-prim mapped to >>>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>>> >>>>>> wired-in package integer-simple mapped to >>>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>>> >>>>>> wired-in package base mapped to >>>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>>> >>>>>> wired-in package rts mapped to builtin_rts >>>>>> >>>>>> wired-in package template-haskell mapped to >>>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>>> >>>>>> wired-in package dph-seq not found. >>>>>> >>>>>> wired-in package dph-par not found. >>>>>> >>>>>> *** Chasing dependencies: >>>>>> >>>>>> Chasing modules from: *Main.hs >>>>>> >>>>>> >>>>>> Main.hs:5:8: >>>>>> >>>>>> Could not find module 'IOS.Touch' >>>>>> >>>>>> Locations searched: >>>>>> >>>>>> IOS/Touch.hs >>>>>> >>>>>> IOS/Touch.lhs >>>>>> >>>>>> *** Deleting temp files: >>>>>> >>>>>> Deleting: >>>>>> >>>>>> *** Deleting temp dirs: >>>>>> >>>>>> Deleting: >>>>>> >>>>>> >>>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is one >>>>>> of the reasons I'm trying to use cabal, since it seems to be pretty good at >>>>>> running hsc2hs on that file automagically. Though ghc is supposed to work >>>>>> with .hsc, no? >>>>>> >>>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>>> >>>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>>> >>>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>>> (armv7): IOS/Touch.hsc >>>>>> >>>>>> Undefined symbols for architecture armv7: >>>>>> >>>>>> "_ZCMain_main_closure", referenced from: >>>>>> >>>>>> _main in ghc85846_2.o >>>>>> >>>>>> ld: symbol(s) not found for architecture armv7 >>>>>> >>>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>>> invocation) >>>>>> >>>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>>> (armv7s): IOS/Touch.hsc >>>>>> >>>>>> Undefined symbols for architecture armv7s: >>>>>> >>>>>> "_ZCMain_main_closure", referenced from: >>>>>> >>>>>> _main in ghc85846_2.o >>>>>> >>>>>> ld: symbol(s) not found for architecture armv7s >>>>>> >>>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>>> invocation) >>>>>> >>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >>>>>> can't open input file: a-armv7.o (No such file or directory) >>>>>> >>>>>> rm: a-armv7.o: No such file or directory >>>>>> >>>>>> rm: a-armv7s.o: No such file or directory >>>>>> >>>>>> >>>>>> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >>>>>> maxwellswadling at gmail.com> wrote: >>>>>> >>>>>>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>>>>>> >>>>>>> Also I'm not sure why you have a Main.a as well. You should link the >>>>>>> Blocks.a in Xcode. You shouldn't need two .a's. >>>>>>> >>>>>>> __END__ Maxwell Swadling >>>>>>> >>>>>>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>>>>>> carter.schonwald at gmail.com> wrote: >>>>>>> >>>>>>> Aren't there some settings that need to be manipulated in Xcode? >>>>>>> Like "don't run strip. Just don't"? Are you doing that stuff? >>>>>>> >>>>>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>>>>> >>>>>>>> Sorry in the last message I meant "(with the list of _warnings_ >>>>>>>> mentioned on the wiki)". >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally < >>>>>>>> efsubenovex at gmail.com> wrote: >>>>>>>> >>>>>>>> I'll sum up the process I'm going through. I `cd` into Blocks where >>>>>>>> Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>>>>>> --config-file=path/to/arm/config build`. The config file was created by >>>>>>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>>>>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>>>>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>>>>>> outputs - as it isn't specified): >>>>>>>> >>>>>>>> Resolving dependencies... >>>>>>>> >>>>>>>> Configuring Blocks-0.1.0.0... >>>>>>>> >>>>>>>> Building Blocks-0.1.0.0... >>>>>>>> >>>>>>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>>>>>> >>>>>>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>>>>>> >>>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>>> can't locate file for: -lpthread >>>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>>> file: -lpthread is not an object file (not allowed in a library) >>>>>>>> >>>>>>>> With ghc-options: -staticlib it looks like the build completes >>>>>>>> (with the list of errors mentioned on the wiki). I then have two libs, >>>>>>>> src/Main.a and dist-arm/build/Blocks/Blocks.a >>>>>>>> >>>>>>>> I then add either Blocks.a or Main.a to my project (or both, which >>>>>>>> I've also tried). Then I build for my device with command-b. Both static >>>>>>>> libs are ignored for each architecture and then clang ends in a linker >>>>>>>> error. Here is the build log from Xcode: http://lpaste.net/97304and my setup: >>>>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c and the >>>>>>>> source: https://github.com/schell/blocks-ios/ >>>>>>>> >>>>>>>> Please let me know if you need more information. >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally < >>>>>>>> efsubenovex at gmail.com> wrote: >>>>>>>> >>>>>>>> Currently I'm using `arm-apple-darwin10-cabal >>>>>>>> --config-file=path/to/my/arm/config build >>>>>>>> >>>>>>>> The cabal file and the rest of the source can be found at >>>>>>>> https://github.com/schell/blocks-ios/ >>>>>>>> >>>>>>>> I'm following the directions at >>>>>>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOSas much as possible but I don't really know how to use ghc to build all the >>>>>>>> files in a project (when I try it can't find the IOS.Touch module), which >>>>>>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>>>>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>>>>>> me if I'm making some obvious mistake. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>>>>>> maxwellswadling at gmail.com> wrote: >>>>>>>> >>>>>>>> How are you compiling the static library? What command are you >>>>>>>> using? >>>>>>>> >>>>>>>> __END__ >>>>>>>> Maxwell Swadling >>>>>>>> >>>>>>>> On 21 Dec 2013, at 10:24 am, Schell Scivally >>>>>>>> wrote: >>>>>>>> >>>>>>>> Carter pointed out I only mentioned the warning. ld spits out a >>>>>>>> warning and then the build fails in the linking phase because the static >>>>>>>> lib was ignored and not linked, making the main() provided by the lib >>>>>>>> undefined: >>>>>>>> >>>>>>>> ld: warning: ignoring file >>>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>>>>> was built for archive which is not the architecture being linked (armv7): >>>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>>>>> >>>>>>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>>>>>> >>>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Schell Scivally >>>>>> http://blog.efnx.com >>>>>> http://github.com/schell >>>>>> http://twitter.com/schellsan >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>> >>>> >>>> >>>> -- >>>> Maxwell Swadling >>>> >>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >> >> >> >> -- >> Maxwell Swadling >> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > > _______________________________________________ > iPhone mailing list > iPhone at haskell.org > http://www.haskell.org/mailman/listinfo/iphone > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Mon Dec 23 18:03:21 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Mon, 23 Dec 2013 10:03:21 -0800 Subject: [Haskell-iPhone] ld: warning with HEAD In-Reply-To: References: <91AC2FF7-B107-452F-AC46-E6F641A5F2AE@gmail.com> <4BF10A9C-82D2-4780-8CD0-E211C8A3149D@gmail.com> Message-ID: Awesome, thanks Luke. That was the problem with cabal. I am still running into errors when linking the lib to my project in Xcode, but I have another email thread corresponding to that, so I'll move the conversation over there. Thanks again. On Mon, Dec 23, 2013 at 2:01 AM, Luke Iannini wrote: > Just saw this, and can thus confirm you've indeed got the troublesome > "jobs: $ncpus" line in there : ). I'll add some stronger wording to the > wiki to make sure people get that removed until it's fixed on cabal's side. > > I also just discovered your https://github.com/schell/blocks-ios project, > that's awesome -- that should be a fantastic demo project to get people > started so thanks so much for working on it. Keep emailing if you have more > trouble, I'll be sure to help as quickly as I can. > > Cheers > Luke > > > On Fri, Dec 20, 2013 at 10:22 PM, Schell Scivally wrote: > >> My cabal config is a vanilla config file generated by >> arm-apple-darwin10-cabal: http://lpaste.net/97322 >> >> >> On Fri, Dec 20, 2013 at 8:23 PM, Maxwell Swadling < >> maxwellswadling at gmail.com> wrote: >> >>> I think you need to set your "--package-db" option when using ghc-pkg >>> the subsequently ghc. >>> >>> The value should be in the cabal config file. >>> >>> Can you post your cabal config? >>> >>> >>> >>> On Sat, Dec 21, 2013 at 3:15 PM, Schell Scivally wrote: >>> >>>> No, I'm not - I'm using arm-apple-darwin10-cabal >>>> --config-file=path/to/arm.config install vector, which yields: >>>> >>>> Resolving dependencies... >>>> >>>> All the requested packages are already installed: >>>> >>>> vector-0.10.9.1 >>>> >>>> Use --reinstall if you want to reinstall anyway. >>>> >>>> Though it doesn't look like it's actually installed: >>>> >>>> arm-apple-darwin10-ghc-pkg list >>>> >>>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d >>>> >>>> Cabal-1.18.1.2 >>>> >>>> array-0.5.0.0 >>>> >>>> base-4.7.0.0 >>>> >>>> bin-package-db-0.0.0.0 >>>> >>>> binary-0.7.1.0 >>>> >>>> bytestring-0.10.4.0 >>>> >>>> containers-0.5.3.1 >>>> >>>> deepseq-1.3.0.2 >>>> >>>> directory-1.2.0.2 >>>> >>>> filepath-1.3.0.2 >>>> >>>> ghc-prim-0.3.1.0 >>>> >>>> hoopl-3.10.0.0 >>>> >>>> hpc-0.6.0.1 >>>> >>>> integer-simple-0.1.1.0 >>>> >>>> old-locale-1.0.0.6 >>>> >>>> pretty-1.1.1.1 >>>> >>>> process-1.2.0.0 >>>> >>>> rts-1.0 >>>> >>>> template-haskell-2.9.0.0 >>>> >>>> time-1.4.1 >>>> >>>> transformers-0.3.0.0 >>>> >>>> unix-2.7.0.0 >>>> >>>> If I don't include my arm.config file I get this: >>>> >>>> arm-apple-darwin10-cabal install vector >>>> >>>> Resolving dependencies... >>>> >>>> Configuring primitive-0.5.1.0... >>>> >>>> Failed to install primitive-0.5.1.0 >>>> >>>> Last 10 lines of the build log ( >>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>> >>>> cabal: Error: some packages failed to install: >>>> >>>> primitive-0.5.1.0 failed during the configure step. The exception was: >>>> >>>> ExitFailure 127 >>>> >>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install >>>> >>>> >>>> >>>> >>>> On Fri, Dec 20, 2013 at 8:11 PM, Maxwell Swadling < >>>> maxwellswadling at gmail.com> wrote: >>>> >>>>> were you using cabal sandbox? If so, delete the cabal sandbox and >>>>> cabal install the dependencies (vector in this case is missing). >>>>> >>>>> >>>>> On Sat, Dec 21, 2013 at 3:08 PM, Schell Scivally < >>>>> efsubenovex at gmail.com> wrote: >>>>> >>>>>> Okay, the hsc2hs step worked and I have IOS/Touch.hs. Now the next >>>>>> error is: >>>>>> >>>>>> arm-apple-darwin10-ghc -staticlib Main.hs -threaded >>>>>> >>>>>> IOS/Touch.hsc:6:8: >>>>>> >>>>>> Could not find module 'Data.Vector.Storable' >>>>>> >>>>>> Use -v to see a list of the files searched for. >>>>>> >>>>>> >>>>>> Is there a way for me to manually include the Data.Vector.Storable >>>>>> package? >>>>>> >>>>>> >>>>>> On Fri, Dec 20, 2013 at 6:26 PM, Maxwell Swadling < >>>>>> maxwellswadling at gmail.com> wrote: >>>>>> >>>>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is >>>>>>> one of the reasons I'm trying to use cabal, since it seems to be pretty >>>>>>> good at running hsc2hs on that file automagically. Though ghc is supposed >>>>>>> to work with .hsc, no? >>>>>>> >>>>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>>>> >>>>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>>>> >>>>>>> GHC doesn't! >>>>>>> >>>>>>> You should be able to run `hsc2hs IOS/Touch/Touch.hsc` and it will >>>>>>> produce `IOS/Touch/Touch.hs`. >>>>>>> >>>>>>> You will have to add any header include paths you need (CocoaTouch >>>>>>> ?). >>>>>>> >>>>>>> I would recommend a vanilla makefile to run `hsc2hs` then `ghc`. >>>>>>> >>>>>>> On 21/12/2013, at 1:01 PM, Schell Scivally >>>>>>> wrote: >>>>>>> >>>>>>> Carter: Yes, I've followed the instructions on the wiki and updated >>>>>>> Xcode's build settings. >>>>>>> Maxwell: When I try it errors with: >>>>>>> >>>>>>> arm-apple-darwin10-ghc Main.hs -o Main.a >>>>>>> >>>>>>> Main.hs:5:8: >>>>>>> >>>>>>> Could not find module 'IOS.Touch' >>>>>>> >>>>>>> Use -v to see a list of the files searched for. >>>>>>> >>>>>>> >>>>>>> And then following it down the rabbit hole: >>>>>>> >>>>>>> arm-apple-darwin10-ghc Main.hs -o Main.a -v >>>>>>> >>>>>>> Glasgow Haskell Compiler, Version 7.7.20131217, stage 1 booted by >>>>>>> GHC version 7.6.3 >>>>>>> >>>>>>> Using binary package database: >>>>>>> /usr/local/lib/arm-apple-darwin10-ghc-7.7.20131217/package.conf.d/package.cache >>>>>>> >>>>>>> wired-in package ghc-prim mapped to >>>>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>>>> >>>>>>> wired-in package integer-simple mapped to >>>>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>>>> >>>>>>> wired-in package base mapped to >>>>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>>>> >>>>>>> wired-in package rts mapped to builtin_rts >>>>>>> >>>>>>> wired-in package template-haskell mapped to >>>>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>>>> >>>>>>> wired-in package dph-seq not found. >>>>>>> >>>>>>> wired-in package dph-par not found. >>>>>>> >>>>>>> Hsc static flags: >>>>>>> >>>>>>> wired-in package ghc-prim mapped to >>>>>>> ghc-prim-0.3.1.0-ba68fe37a0bba905324e76d7bb331c12 >>>>>>> >>>>>>> wired-in package integer-simple mapped to >>>>>>> integer-simple-0.1.1.0-abf1895bcd711c07e5c06ea0798b38ff >>>>>>> >>>>>>> wired-in package base mapped to >>>>>>> base-4.7.0.0-725128dc24ae24a83ca24be4defe9728 >>>>>>> >>>>>>> wired-in package rts mapped to builtin_rts >>>>>>> >>>>>>> wired-in package template-haskell mapped to >>>>>>> template-haskell-2.9.0.0-dc5244f6b2a07b2bd654d776e81eb7ba >>>>>>> >>>>>>> wired-in package dph-seq not found. >>>>>>> >>>>>>> wired-in package dph-par not found. >>>>>>> >>>>>>> *** Chasing dependencies: >>>>>>> >>>>>>> Chasing modules from: *Main.hs >>>>>>> >>>>>>> >>>>>>> Main.hs:5:8: >>>>>>> >>>>>>> Could not find module 'IOS.Touch' >>>>>>> >>>>>>> Locations searched: >>>>>>> >>>>>>> IOS/Touch.hs >>>>>>> >>>>>>> IOS/Touch.lhs >>>>>>> >>>>>>> *** Deleting temp files: >>>>>>> >>>>>>> Deleting: >>>>>>> >>>>>>> *** Deleting temp dirs: >>>>>>> >>>>>>> Deleting: >>>>>>> >>>>>>> >>>>>>> So it doesn't know how to deal with IOS/Touch/Touch.hsc, which is >>>>>>> one of the reasons I'm trying to use cabal, since it seems to be pretty >>>>>>> good at running hsc2hs on that file automagically. Though ghc is supposed >>>>>>> to work with .hsc, no? >>>>>>> >>>>>>> If I try to compile Touch.hsc by itself I get something interesting: >>>>>>> >>>>>>> arm-apple-darwin10-ghc IOS/Touch.hsc >>>>>>> >>>>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>>>> (armv7): IOS/Touch.hsc >>>>>>> >>>>>>> Undefined symbols for architecture armv7: >>>>>>> >>>>>>> "_ZCMain_main_closure", referenced from: >>>>>>> >>>>>>> _main in ghc85846_2.o >>>>>>> >>>>>>> ld: symbol(s) not found for architecture armv7 >>>>>>> >>>>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>>>> invocation) >>>>>>> >>>>>>> ld: warning: ignoring file IOS/Touch.hsc, file was built for >>>>>>> unsupported file format ( 0x7B 0x2D 0x23 0x20 0x4C 0x41 0x4E 0x47 0x55 0x41 >>>>>>> 0x47 0x45 0x20 0x46 0x6F 0x72 ) which is not the architecture being linked >>>>>>> (armv7s): IOS/Touch.hsc >>>>>>> >>>>>>> Undefined symbols for architecture armv7s: >>>>>>> >>>>>>> "_ZCMain_main_closure", referenced from: >>>>>>> >>>>>>> _main in ghc85846_2.o >>>>>>> >>>>>>> ld: symbol(s) not found for architecture armv7s >>>>>>> >>>>>>> clang: error: linker command failed with exit code 1 (use -v to see >>>>>>> invocation) >>>>>>> >>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: >>>>>>> can't open input file: a-armv7.o (No such file or directory) >>>>>>> >>>>>>> rm: a-armv7.o: No such file or directory >>>>>>> >>>>>>> rm: a-armv7s.o: No such file or directory >>>>>>> >>>>>>> >>>>>>> On Fri, Dec 20, 2013 at 5:49 PM, Maxwell Swadling < >>>>>>> maxwellswadling at gmail.com> wrote: >>>>>>> >>>>>>>> Can you run arm-apple-darwin10-ghc Blocks.hs -o Blocks.a ? >>>>>>>> >>>>>>>> Also I'm not sure why you have a Main.a as well. You should link >>>>>>>> the Blocks.a in Xcode. You shouldn't need two .a's. >>>>>>>> >>>>>>>> __END__ Maxwell Swadling >>>>>>>> >>>>>>>> On 21 Dec 2013, at 12:43 pm, Carter Schonwald < >>>>>>>> carter.schonwald at gmail.com> wrote: >>>>>>>> >>>>>>>> Aren't there some settings that need to be manipulated in Xcode? >>>>>>>> Like "don't run strip. Just don't"? Are you doing that stuff? >>>>>>>> >>>>>>>> On Friday, December 20, 2013, Schell Scivally wrote: >>>>>>>> >>>>>>>>> Sorry in the last message I meant "(with the list of _warnings_ >>>>>>>>> mentioned on the wiki)". >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, Dec 20, 2013 at 5:10 PM, Schell Scivally < >>>>>>>>> efsubenovex at gmail.com> wrote: >>>>>>>>> >>>>>>>>> I'll sum up the process I'm going through. I `cd` into Blocks >>>>>>>>> where Blocks.cabal lives, then I do a `arm-apple-darwin10-cabal >>>>>>>>> --config-file=path/to/arm/config build`. The config file was created by >>>>>>>>> arm-apple-darwin10-cabal the first time I ran it. The build ends in two >>>>>>>>> different ways depending on the `ghc-options` field in the Blocks.cabal >>>>>>>>> file. With ghc-options: -staticlib -threaded it errors (or warns, or >>>>>>>>> outputs - as it isn't specified): >>>>>>>>> >>>>>>>>> Resolving dependencies... >>>>>>>>> >>>>>>>>> Configuring Blocks-0.1.0.0... >>>>>>>>> >>>>>>>>> Building Blocks-0.1.0.0... >>>>>>>>> >>>>>>>>> Preprocessing executable 'Blocks' for Blocks-0.1.0.0... >>>>>>>>> >>>>>>>>> Linking dist-arm/build/Blocks/Blocks.a ... >>>>>>>>> >>>>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>>>> can't locate file for: -lpthread >>>>>>>>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: >>>>>>>>> file: -lpthread is not an object file (not allowed in a library) >>>>>>>>> >>>>>>>>> With ghc-options: -staticlib it looks like the build completes >>>>>>>>> (with the list of errors mentioned on the wiki). I then have two libs, >>>>>>>>> src/Main.a and dist-arm/build/Blocks/Blocks.a >>>>>>>>> >>>>>>>>> I then add either Blocks.a or Main.a to my project (or both, which >>>>>>>>> I've also tried). Then I build for my device with command-b. Both static >>>>>>>>> libs are ignored for each architecture and then clang ends in a linker >>>>>>>>> error. Here is the build log from Xcode: http://lpaste.net/97304and my setup: >>>>>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c and the >>>>>>>>> source: https://github.com/schell/blocks-ios/ >>>>>>>>> >>>>>>>>> Please let me know if you need more information. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, Dec 20, 2013 at 4:38 PM, Schell Scivally < >>>>>>>>> efsubenovex at gmail.com> wrote: >>>>>>>>> >>>>>>>>> Currently I'm using `arm-apple-darwin10-cabal >>>>>>>>> --config-file=path/to/my/arm/config build >>>>>>>>> >>>>>>>>> The cabal file and the rest of the source can be found at >>>>>>>>> https://github.com/schell/blocks-ios/ >>>>>>>>> >>>>>>>>> I'm following the directions at >>>>>>>>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOSas much as possible but I don't really know how to use ghc to build all the >>>>>>>>> files in a project (when I try it can't find the IOS.Touch module), which >>>>>>>>> is why I'm trying to use cabal. That wiki page says nothing of using cabal >>>>>>>>> so I'm assuming that I'm in dragon territory with most of this, so forgive >>>>>>>>> me if I'm making some obvious mistake. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, Dec 20, 2013 at 4:27 PM, Maxwell Swadling < >>>>>>>>> maxwellswadling at gmail.com> wrote: >>>>>>>>> >>>>>>>>> How are you compiling the static library? What command are you >>>>>>>>> using? >>>>>>>>> >>>>>>>>> __END__ >>>>>>>>> Maxwell Swadling >>>>>>>>> >>>>>>>>> On 21 Dec 2013, at 10:24 am, Schell Scivally < >>>>>>>>> efsubenovex at gmail.com> wrote: >>>>>>>>> >>>>>>>>> Carter pointed out I only mentioned the warning. ld spits out a >>>>>>>>> warning and then the build fails in the linking phase because the static >>>>>>>>> lib was ignored and not linked, making the main() provided by the lib >>>>>>>>> undefined: >>>>>>>>> >>>>>>>>> ld: warning: ignoring file >>>>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a, file >>>>>>>>> was built for archive which is not the architecture being linked (armv7): >>>>>>>>> /Users/schell/Code/blocks-ios/Blocks/dist-arm/build/Blocks/Blocks.a >>>>>>>>> >>>>>>>>> ld: warning: ignoring file /Users/schell/Code/blocks-ios/Blocks >>>>>>>>> >>>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Schell Scivally >>>>>>> http://blog.efnx.com >>>>>>> http://github.com/schell >>>>>>> http://twitter.com/schellsan >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Schell Scivally >>>>>> http://blog.efnx.com >>>>>> http://github.com/schell >>>>>> http://twitter.com/schellsan >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Maxwell Swadling >>>>> >>>>> >>>> >>>> >>>> -- >>>> Schell Scivally >>>> http://blog.efnx.com >>>> http://github.com/schell >>>> http://twitter.com/schellsan >>>> >>> >>> >>> >>> -- >>> Maxwell Swadling >>> >>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Mon Dec 23 18:29:00 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Mon, 23 Dec 2013 10:29:00 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: It looks like nuking jobs: $ncpus did the trick. I now have primitive and vector installed and confirmed with arm-apple-darwin10-ghc. After building my static lib the next issue is that I'm having a lot of linking errors in Xcode. Here is the build log: https://gist.github.com/schell/f10af8c0d29e24da5c25 On Sun, Dec 22, 2013 at 4:47 PM, Luke Iannini wrote: > Hey Schell, > > I think I see the issue ? did you see the note in section 6 of > https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOSregarding the > jobs: $ncpus > option in ~/.cabal/config ? > If you've got that, nuke it and see if that fixes it. > > I need to file a bug about that with the Cabal team. > > I've also been meaning to warn ? I am pretty sure the fat armv7s/armv7 > binary approach taken by arm-apple-darwin10-ghc doesn't fully work yet (I > was convinced it did when I implemented it, but recent testing with armv7 > and armv7s devices show missing symbols for one arch or the other). I > haven't had nearly the time to work on it and if anyone's looking for a way > to help with GHC iOS that's a great self-contained problem to work on : ). > > If we can't get that approach to work (intercepting build commands and > lipoing things together on the fly), there's always the approach of > building one GHC for each armv7 and armv7s, but that's got its own pain > points since GHC calls both of those just "arm" internally and you have to > do some yucky stuff with directory management :/ (that's what I've done > here, and it works at least : )). > > Hopefully I'll be out of the woods in my primary work soon and able to > devote more cycles help in cleaning these things up. > > Cheers > Luke > > > On Sun, Dec 22, 2013 at 4:22 PM, Schell Scivally wrote: > >> The primitive log is empty, nothing is printed to it. The version of >> vector I'm trying to build is 0.10.9.1, which is currently on hackage. I've >> also tried building primitive 0.5.2.0 by hand - cloning it from github and >> then running arm-apple-darwin10-cabal install and it stops at the same >> error. Nothing is printed to the log file. If I try each step separately >> (configure, build, install) I can configure fine and building gives this >> output: >> >> Building primitive-0.5.2.0... >> >> Preprocessing library primitive-0.5.2.0... >> >> [ 1 of 10] Compiling Data.Primitive.Internal.Compat ( >> Data/Primitive/Internal/Compat.hs, >> dist-arm/build/Data/Primitive/Internal/Compat.o ) >> >> [ 2 of 10] Compiling Data.Primitive.MachDeps ( >> Data/Primitive/MachDeps.hs, dist-arm/build/Data/Primitive/MachDeps.o ) >> >> [ 3 of 10] Compiling Data.Primitive.Internal.Operations ( >> Data/Primitive/Internal/Operations.hs, >> dist-arm/build/Data/Primitive/Internal/Operations.o ) >> >> [ 4 of 10] Compiling Control.Monad.Primitive ( >> Control/Monad/Primitive.hs, dist-arm/build/Control/Monad/Primitive.o ) >> >> [ 5 of 10] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, >> dist-arm/build/Data/Primitive/Types.o ) >> >> [ 6 of 10] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, >> dist-arm/build/Data/Primitive/Array.o ) >> >> [ 7 of 10] Compiling Data.Primitive.ByteArray ( >> Data/Primitive/ByteArray.hs, dist-arm/build/Data/Primitive/ByteArray.o ) >> >> [ 8 of 10] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, >> dist-arm/build/Data/Primitive/Addr.o ) >> >> [ 9 of 10] Compiling Data.Primitive ( Data/Primitive.hs, >> dist-arm/build/Data/Primitive.o ) >> >> [10 of 10] Compiling Data.Primitive.MutVar ( Data/Primitive/MutVar.hs, >> dist-arm/build/Data/Primitive/MutVar.o ) >> >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: >> archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and >> ar(1) will not be able to operate on it >> In-place registering primitive-0.5.2.0... >> >> And then installing gives: >> >> Resolving dependencies... >> >> Configuring primitive-0.5.2.0... >> >> Failed to install primitive-0.5.2.0 >> >> Last 10 lines of the build log ( >> /Users/schell/.cabal/logs/primitive-0.5.2.0.log ): >> >> cabal: Error: some packages failed to install: >> >> primitive-0.5.2.0 failed during the configure step. The exception was: >> >> ExitFailure 127 >> >> To me it seems like the line >> "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: >> archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and >> ar(1) will not be able to operate on it" could be important? Does that >> sound like it may have something to do with the install failure? >> >> >> >> On Sun, Dec 22, 2013 at 2:49 PM, Carter Schonwald < >> carter.schonwald at gmail.com> wrote: >> >>> Oooooo. What version of vector are you using? It needs to be the one >>> for ghc HEAD. >>> >>> >>> On Sunday, December 22, 2013, Carter Schonwald wrote: >>> >>>> Could you also share the primitive log? Seems like something is >>>> happening there. >>>> Can't you just build primitive by hand then vector? >>>> >>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>> >>>>> Ah, cool - I didn't know that the verbosity arg took a parameter. Here >>>>> is the full output: >>>>> https://gist.github.com/schell/7c08631f52e1e6f54a39 >>>>> >>>>> >>>>> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >>>>> carter.schonwald at gmail.com> wrote: >>>>> >>>>>> The -v flag is for cabal. Be sure to post a link to the full output. >>>>>> >>>>>> >>>>>> >>>>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>>>> >>>>>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>>>>> looks like I just went in a circle and now I'm back at the same problem >>>>>>> from my first message: >>>>>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>>>>> >>>>>>> I'm trying to cabal install vector but it's failing while installing >>>>>>> primitive. The log file shows no error, so it looks like it's silently >>>>>>> erring. My setup is here: >>>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>>>> Just for posterity I'll post the output from >>>>>>> `arm-apple-darwin10-cabal install vector`: >>>>>>> >>>>>>> Resolving dependencies... >>>>>>> >>>>>>> Configuring primitive-0.5.1.0... >>>>>>> >>>>>>> Failed to install primitive-0.5.1.0 >>>>>>> >>>>>>> Last 10 lines of the build log ( >>>>>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>>>>> >>>>>>> cabal: Error: some packages failed to install: >>>>>>> >>>>>>> primitive-0.5.1.0 failed during the configure step. The exception >>>>>>> was: >>>>>>> >>>>>>> ExitFailure 127 >>>>>>> >>>>>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to install. >>>>>>> >>>>>>> The build log is empty. >>>>>>> Furthermore, for a while I was trying to use cabal like >>>>>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>>>>> pointing it to a custom cabal file (one that was just autogenerated the >>>>>>> first time I issued the command). This looked like it was working, but it >>>>>>> says that the package is already installed. If I don't include the >>>>>>> --config-file option it errs like above. >>>>>>> >>>>>>> Using arm-apple-darwin10-ghc to build my project is failing because >>>>>>> it can't find Data.Vector.Storable but I can't seem to get cabal to install >>>>>>> it in the correct location. >>>>>>> >>>>>>> -- >>>>>>> Schell Scivally >>>>>>> http://blog.efnx.com >>>>>>> http://github.com/schell >>>>>>> http://twitter.com/schellsan >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Schell Scivally >>>>> http://blog.efnx.com >>>>> http://github.com/schell >>>>> http://twitter.com/schellsan >>>>> >>>> >> >> >> -- >> Schell Scivally >> http://blog.efnx.com >> http://github.com/schell >> http://twitter.com/schellsan >> >> _______________________________________________ >> iPhone mailing list >> iPhone at haskell.org >> http://www.haskell.org/mailman/listinfo/iphone >> >> > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukexipd at gmail.com Tue Dec 24 00:14:57 2013 From: lukexipd at gmail.com (Luke Iannini) Date: Mon, 23 Dec 2013 16:14:57 -0800 Subject: [Haskell-iPhone] More arm-apple-darwin10-ghc trouble In-Reply-To: References: Message-ID: Hi Schell, If you're building onto a 4S/iPad4 or later, you're probably partially running into the thing I mentioned wherein the arm-apple-darwin10-clang script isn't quite correctly generating fat binaries for armv7 and armv7s yet. I reverted it back to just doing armv7s (you'd have to switch it to armv7 if you wanted an earlier device): https://github.com/ghc-ios/ghc-ios-scripts/blob/master/arm-apple-darwin10-clang You'll have to rebuild GHC with this :P. Also, in "Build Settings", change "Architectures" to "Standard Architectures (armv7, armv7s)" (as opposed to "(including 64-bit)") which should fix the Arm64 messages (just added this to the wiki ? we're awaiting llvm code from Apple before we can support Arm64), and possibly set "Valid Architectures" to just armv7s or armv7 depending on which device you're building for until we get the fat stuff figured out. Cheers Luke On Mon, Dec 23, 2013 at 10:29 AM, Schell Scivally wrote: > It looks like nuking jobs: $ncpus did the trick. I now have primitive and > vector installed and confirmed with arm-apple-darwin10-ghc. After building > my static lib the next issue is that I'm having a lot of linking errors in > Xcode. Here is the build log: > https://gist.github.com/schell/f10af8c0d29e24da5c25 > > > On Sun, Dec 22, 2013 at 4:47 PM, Luke Iannini wrote: > >> Hey Schell, >> >> I think I see the issue ? did you see the note in section 6 of >> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOSregarding the >> jobs: $ncpus >> option in ~/.cabal/config ? >> If you've got that, nuke it and see if that fixes it. >> >> I need to file a bug about that with the Cabal team. >> >> I've also been meaning to warn ? I am pretty sure the fat armv7s/armv7 >> binary approach taken by arm-apple-darwin10-ghc doesn't fully work yet (I >> was convinced it did when I implemented it, but recent testing with armv7 >> and armv7s devices show missing symbols for one arch or the other). I >> haven't had nearly the time to work on it and if anyone's looking for a way >> to help with GHC iOS that's a great self-contained problem to work on : ). >> >> If we can't get that approach to work (intercepting build commands and >> lipoing things together on the fly), there's always the approach of >> building one GHC for each armv7 and armv7s, but that's got its own pain >> points since GHC calls both of those just "arm" internally and you have to >> do some yucky stuff with directory management :/ (that's what I've done >> here, and it works at least : )). >> >> Hopefully I'll be out of the woods in my primary work soon and able to >> devote more cycles help in cleaning these things up. >> >> Cheers >> Luke >> >> >> On Sun, Dec 22, 2013 at 4:22 PM, Schell Scivally wrote: >> >>> The primitive log is empty, nothing is printed to it. The version of >>> vector I'm trying to build is 0.10.9.1, which is currently on hackage. I've >>> also tried building primitive 0.5.2.0 by hand - cloning it from github and >>> then running arm-apple-darwin10-cabal install and it stops at the same >>> error. Nothing is printed to the log file. If I try each step separately >>> (configure, build, install) I can configure fine and building gives this >>> output: >>> >>> Building primitive-0.5.2.0... >>> >>> Preprocessing library primitive-0.5.2.0... >>> >>> [ 1 of 10] Compiling Data.Primitive.Internal.Compat ( >>> Data/Primitive/Internal/Compat.hs, >>> dist-arm/build/Data/Primitive/Internal/Compat.o ) >>> >>> [ 2 of 10] Compiling Data.Primitive.MachDeps ( >>> Data/Primitive/MachDeps.hs, dist-arm/build/Data/Primitive/MachDeps.o ) >>> >>> [ 3 of 10] Compiling Data.Primitive.Internal.Operations ( >>> Data/Primitive/Internal/Operations.hs, >>> dist-arm/build/Data/Primitive/Internal/Operations.o ) >>> >>> [ 4 of 10] Compiling Control.Monad.Primitive ( >>> Control/Monad/Primitive.hs, dist-arm/build/Control/Monad/Primitive.o ) >>> >>> [ 5 of 10] Compiling Data.Primitive.Types ( Data/Primitive/Types.hs, >>> dist-arm/build/Data/Primitive/Types.o ) >>> >>> [ 6 of 10] Compiling Data.Primitive.Array ( Data/Primitive/Array.hs, >>> dist-arm/build/Data/Primitive/Array.o ) >>> >>> [ 7 of 10] Compiling Data.Primitive.ByteArray ( >>> Data/Primitive/ByteArray.hs, dist-arm/build/Data/Primitive/ByteArray.o ) >>> >>> [ 8 of 10] Compiling Data.Primitive.Addr ( Data/Primitive/Addr.hs, >>> dist-arm/build/Data/Primitive/Addr.o ) >>> >>> [ 9 of 10] Compiling Data.Primitive ( Data/Primitive.hs, >>> dist-arm/build/Data/Primitive.o ) >>> >>> [10 of 10] Compiling Data.Primitive.MutVar ( Data/Primitive/MutVar.hs, >>> dist-arm/build/Data/Primitive/MutVar.o ) >>> >>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: >>> archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and >>> ar(1) will not be able to operate on it >>> In-place registering primitive-0.5.2.0... >>> >>> And then installing gives: >>> >>> Resolving dependencies... >>> >>> Configuring primitive-0.5.2.0... >>> >>> Failed to install primitive-0.5.2.0 >>> >>> Last 10 lines of the build log ( >>> /Users/schell/.cabal/logs/primitive-0.5.2.0.log ): >>> >>> cabal: Error: some packages failed to install: >>> >>> primitive-0.5.2.0 failed during the configure step. The exception was: >>> >>> ExitFailure 127 >>> >>> To me it seems like the line >>> "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: >>> archive library: dist-arm/build/libHSprimitive-0.5.2.0.a will be fat and >>> ar(1) will not be able to operate on it" could be important? Does that >>> sound like it may have something to do with the install failure? >>> >>> >>> >>> On Sun, Dec 22, 2013 at 2:49 PM, Carter Schonwald < >>> carter.schonwald at gmail.com> wrote: >>> >>>> Oooooo. What version of vector are you using? It needs to be the one >>>> for ghc HEAD. >>>> >>>> >>>> On Sunday, December 22, 2013, Carter Schonwald wrote: >>>> >>>>> Could you also share the primitive log? Seems like something is >>>>> happening there. >>>>> Can't you just build primitive by hand then vector? >>>>> >>>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>>> >>>>>> Ah, cool - I didn't know that the verbosity arg took a parameter. >>>>>> Here is the full output: >>>>>> https://gist.github.com/schell/7c08631f52e1e6f54a39 >>>>>> >>>>>> >>>>>> On Sun, Dec 22, 2013 at 1:13 PM, Carter Schonwald < >>>>>> carter.schonwald at gmail.com> wrote: >>>>>> >>>>>>> The -v flag is for cabal. Be sure to post a link to the full >>>>>>> output. >>>>>>> >>>>>>> >>>>>>> On Sunday, December 22, 2013, Schell Scivally wrote: >>>>>>> >>>>>>>> Hey guys, I thought I had fixed my issues by rebuilding HEAD but it >>>>>>>> looks like I just went in a circle and now I'm back at the same problem >>>>>>>> from my first message: >>>>>>>> http://www.haskell.org/pipermail/iphone/2013-December/000345.html >>>>>>>> >>>>>>>> I'm trying to cabal install vector but it's failing while >>>>>>>> installing primitive. The log file shows no error, so it looks like it's >>>>>>>> silently erring. My setup is here: >>>>>>>> https://gist.github.com/schell/f3a737171ce2f6b1119c >>>>>>>> Just for posterity I'll post the output from >>>>>>>> `arm-apple-darwin10-cabal install vector`: >>>>>>>> >>>>>>>> Resolving dependencies... >>>>>>>> >>>>>>>> Configuring primitive-0.5.1.0... >>>>>>>> >>>>>>>> Failed to install primitive-0.5.1.0 >>>>>>>> >>>>>>>> Last 10 lines of the build log ( >>>>>>>> /Users/schell/.cabal/logs/primitive-0.5.1.0.log ): >>>>>>>> >>>>>>>> cabal: Error: some packages failed to install: >>>>>>>> >>>>>>>> primitive-0.5.1.0 failed during the configure step. The exception >>>>>>>> was: >>>>>>>> >>>>>>>> ExitFailure 127 >>>>>>>> >>>>>>>> vector-0.10.9.1 depends on primitive-0.5.1.0 which failed to >>>>>>>> install. >>>>>>>> >>>>>>>> The build log is empty. >>>>>>>> Furthermore, for a while I was trying to use cabal like >>>>>>>> `arm-apple-darwin10-cabal --config-file=arm.config install vector`, >>>>>>>> pointing it to a custom cabal file (one that was just autogenerated the >>>>>>>> first time I issued the command). This looked like it was working, but it >>>>>>>> says that the package is already installed. If I don't include the >>>>>>>> --config-file option it errs like above. >>>>>>>> >>>>>>>> Using arm-apple-darwin10-ghc to build my project is failing because >>>>>>>> it can't find Data.Vector.Storable but I can't seem to get cabal to install >>>>>>>> it in the correct location. >>>>>>>> >>>>>>>> -- >>>>>>>> Schell Scivally >>>>>>>> http://blog.efnx.com >>>>>>>> http://github.com/schell >>>>>>>> http://twitter.com/schellsan >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Schell Scivally >>>>>> http://blog.efnx.com >>>>>> http://github.com/schell >>>>>> http://twitter.com/schellsan >>>>>> >>>>> >>> >>> >>> -- >>> Schell Scivally >>> http://blog.efnx.com >>> http://github.com/schell >>> http://twitter.com/schellsan >>> >>> _______________________________________________ >>> iPhone mailing list >>> iPhone at haskell.org >>> http://www.haskell.org/mailman/listinfo/iphone >>> >>> >> > > > -- > Schell Scivally > http://blog.efnx.com > http://github.com/schell > http://twitter.com/schellsan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at interare.com Wed Dec 25 10:39:24 2013 From: joe at interare.com (Joe) Date: Wed, 25 Dec 2013 17:39:24 +0700 Subject: [Haskell-iPhone] Fat binaries on iOS Target Message-ID: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> Hi, I?m asking similar question on haskell-cafe group, but I think it?s more appropriate to ask here since it?s iPhone related. Please forgive my double post. I have been trying to statically link Pandoc packages to iOS application and I want to say that what have been done so far as explained in https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is great! I have finally successfully use Pandoc library in iOS app, but there?s an issue that the final app binary is more than 50MB when using Pandoc library. It?s around 5MB for simple haskell library. And without using Haskell, it?s around 100kb. Is it possible to strip the executable binary? I read that stripping is not possible using xcode strip. I also try to add -split-objs flag, but it?s not working either. Any idea? Is this a known issue? Thanks for making Haskell work on iOS! Best regards and merry christmas, Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Dec 25 13:46:03 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 25 Dec 2013 08:46:03 -0500 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> Message-ID: You need to make sure every lib is built with split objs, not just the final application. Did you try it that way? You could also try to limit the amount of Inlining in your application too On Wednesday, December 25, 2013, Joe wrote: > Hi, > > I?m asking similar question on haskell-cafe group, but I think it?s more > appropriate to ask here since it?s iPhone related. Please forgive my double > post. > > I have been trying to statically link Pandoc packages to iOS application > and I want to say that what have been done so far as explained in > https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is > great! I have finally successfully use Pandoc library in iOS app, but > there?s an issue that the final app binary is *more than 50MB* when using > Pandoc library. It?s around 5MB for simple haskell library. And without > using Haskell, it?s around 100kb. > > Is it possible to strip the executable binary? I read that stripping is > not possible using xcode strip. I also try to add -split-objs flag, but > it?s not working either. > > Any idea? Is this a known issue? > > Thanks for making Haskell work on iOS! > > Best regards and merry christmas, > Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at interare.com Wed Dec 25 14:37:37 2013 From: joe at interare.com (Joe) Date: Wed, 25 Dec 2013 21:37:37 +0700 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> Message-ID: <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Hi Carter, When I have added ?split-objs: True? in .cabal/config file, but when running cabal I got this message: Preprocessing library pandoc-1.12.2.1... unused terminals: 1 on the commandline: Warning: ignoring -fsplit-objs And if I ignore that, at the end of build, I get another error message that stop the build. cabal: dist-i386/build/Text/Pandoc_o_split: does not exist It seems that split-objs cannot work with cross-compilation ghc. What do you think? Best regards, Joe On Dec 25, 2013, at 8:46 PM, Carter Schonwald wrote: > You need to make sure every lib is built with split objs, not just the final application. Did you try it that way? You could also try to limit the amount of Inlining in your application too > > On Wednesday, December 25, 2013, Joe wrote: > Hi, > > I?m asking similar question on haskell-cafe group, but I think it?s more appropriate to ask here since it?s iPhone related. Please forgive my double post. > > I have been trying to statically link Pandoc packages to iOS application and I want to say that what have been done so far as explained in https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is great! I have finally successfully use Pandoc library in iOS app, but there?s an issue that the final app binary is more than 50MB when using Pandoc library. It?s around 5MB for simple haskell library. And without using Haskell, it?s around 100kb. > > Is it possible to strip the executable binary? I read that stripping is not possible using xcode strip. I also try to add -split-objs flag, but it?s not working either. > > Any idea? Is this a known issue? > > Thanks for making Haskell work on iOS! > > Best regards and merry christmas, > Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Dec 25 15:14:43 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 25 Dec 2013 10:14:43 -0500 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Message-ID: Huh. Could you write up a ticket on trac? This could be considered a bug in cross compilation. Explain that you're trying to make sure the object code for iOS is small. @luke, are there any tricks for managing object size you've done There are some ideas to reduce object size for ghc 7.10, but that doesn't help you write now. @Joe: one idea could be to mess with the ghc flags that relate to Inlining. Reducing the amount of Inlining may help with object size, BUT may make things slower. I don't recall what the relevant ghc flags are off hand. You'd have to do some digging. On Wednesday, December 25, 2013, Joe wrote: > Hi Carter, > > When I have added ?split-objs: True? in .cabal/config file, but when > running cabal I got this message: > > Preprocessing library pandoc-1.12.2.1... > unused terminals: 1 > > on the commandline: Warning: ignoring -fsplit-objs > > And if I ignore that, at the end of build, I get another error message > that stop the build. > > cabal: dist-i386/build/Text/Pandoc_o_split: does not exist > > It seems that split-objs cannot work with cross-compilation ghc. > > What do you think? > > Best regards, > Joe > > On Dec 25, 2013, at 8:46 PM, Carter Schonwald > > wrote: > > You need to make sure every lib is built with split objs, not just the > final application. Did you try it that way? You could also try to limit > the amount of Inlining in your application too > > On Wednesday, December 25, 2013, Joe wrote: > >> Hi, >> >> I?m asking similar question on haskell-cafe group, but I think it?s more >> appropriate to ask here since it?s iPhone related. Please forgive my double >> post. >> >> I have been trying to statically link Pandoc packages to iOS application >> and I want to say that what have been done so far as explained in >> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is >> great! I have finally successfully use Pandoc library in iOS app, but >> there?s an issue that the final app binary is *more than 50MB* when >> using Pandoc library. It?s around 5MB for simple haskell library. And >> without using Haskell, it?s around 100kb. >> >> Is it possible to strip the executable binary? I read that stripping is >> not possible using xcode strip. I also try to add -split-objs flag, but >> it?s not working either. >> >> Any idea? Is this a known issue? >> >> Thanks for making Haskell work on iOS! >> >> Best regards and merry christmas, >> Joe >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at interare.com Wed Dec 25 15:41:10 2013 From: joe at interare.com (Joe) Date: Wed, 25 Dec 2013 22:41:10 +0700 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Message-ID: Hi Carter, Sure! Just added new ticket #8629. As for inlining, I think i?ll start learning haskell first before jumping into modifying the code :). Hopefully either split-objs, executable or other some other idea to reduce binary size could be found very soon. Thanks for helping. Best regards, Joe On Dec 25, 2013, at 10:14 PM, Carter Schonwald wrote: > Huh. Could you write up a ticket on trac? This could be considered a bug in cross compilation. Explain that you're trying to make sure the object code for iOS is small. > > @luke, are there any tricks for managing object size you've done > > There are some ideas to reduce object size for ghc 7.10, but that doesn't help you write now. > > > @Joe: one idea could be to mess with the ghc flags that relate to Inlining. Reducing the amount of Inlining may help with object size, BUT may make things slower. I don't recall what the relevant ghc flags are off hand. You'd have to do some digging. > > > > On Wednesday, December 25, 2013, Joe wrote: > Hi Carter, > > When I have added ?split-objs: True? in .cabal/config file, but when running cabal I got this message: > > Preprocessing library pandoc-1.12.2.1... > unused terminals: 1 > > on the commandline: Warning: ignoring -fsplit-objs > > And if I ignore that, at the end of build, I get another error message that stop the build. > > cabal: dist-i386/build/Text/Pandoc_o_split: does not exist > > It seems that split-objs cannot work with cross-compilation ghc. > > What do you think? > > Best regards, > Joe > > On Dec 25, 2013, at 8:46 PM, Carter Schonwald wrote: > >> You need to make sure every lib is built with split objs, not just the final application. Did you try it that way? You could also try to limit the amount of Inlining in your application too >> >> On Wednesday, December 25, 2013, Joe wrote: >> Hi, >> >> I?m asking similar question on haskell-cafe group, but I think it?s more appropriate to ask here since it?s iPhone related. Please forgive my double post. >> >> I have been trying to statically link Pandoc packages to iOS application and I want to say that what have been done so far as explained in https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is great! I have finally successfully use Pandoc library in iOS app, but there?s an issue that the final app binary is more than 50MB when using Pandoc library. It?s around 5MB for simple haskell library. And without using Haskell, it?s around 100kb. >> >> Is it possible to strip the executable binary? I read that stripping is not possible using xcode strip. I also try to add -split-objs flag, but it?s not working either. >> >> Any idea? Is this a known issue? >> >> Thanks for making Haskell work on iOS! >> >> Best regards and merry christmas, >> Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Dec 25 16:14:57 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 25 Dec 2013 11:14:57 -0500 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Message-ID: Woah! Jumping into cross compiling as your way to start learning Haskell? That's pretty awesome. Please continue to share any problems you may have, it's always possible that it could be a bug! On Wednesday, December 25, 2013, Joe wrote: > Hi Carter, > > Sure! Just added new ticket #8629 > . > > As for inlining, I think i?ll start learning haskell first before jumping > into modifying the code :). Hopefully either split-objs, executable or > other some other idea to reduce binary size could be found very soon. > > Thanks for helping. > > Best regards, > Joe > > On Dec 25, 2013, at 10:14 PM, Carter Schonwald > > wrote: > > Huh. Could you write up a ticket on trac? This could be considered a bug > in cross compilation. Explain that you're trying to make sure the object > code for iOS is small. > > @luke, are there any tricks for managing object size you've done > > There are some ideas to reduce object size for ghc 7.10, but that doesn't > help you write now. > > > @Joe: one idea could be to mess with the ghc flags that relate to > Inlining. Reducing the amount of Inlining may help with object size, BUT > may make things slower. I don't recall what the relevant ghc flags are off > hand. You'd have to do some digging. > > > > On Wednesday, December 25, 2013, Joe wrote: > >> Hi Carter, >> >> When I have added ?split-objs: True? in .cabal/config file, but when >> running cabal I got this message: >> >> Preprocessing library pandoc-1.12.2.1... >> unused terminals: 1 >> >> on the commandline: Warning: ignoring -fsplit-objs >> >> And if I ignore that, at the end of build, I get another error message >> that stop the build. >> >> cabal: dist-i386/build/Text/Pandoc_o_split: does not exist >> >> It seems that split-objs cannot work with cross-compilation ghc. >> >> What do you think? >> >> Best regards, >> Joe >> >> On Dec 25, 2013, at 8:46 PM, Carter Schonwald >> wrote: >> >> You need to make sure every lib is built with split objs, not just the >> final application. Did you try it that way? You could also try to limit >> the amount of Inlining in your application too >> >> On Wednesday, December 25, 2013, Joe wrote: >> >>> Hi, >>> >>> I?m asking similar question on haskell-cafe group, but I think it?s more >>> appropriate to ask here since it?s iPhone related. Please forgive my double >>> post. >>> >>> I have been trying to statically link Pandoc packages to iOS application >>> and I want to say that what have been done so far as explained in >>> https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is >>> great! I have finally successfully use Pandoc library in iOS app, but >>> there?s an issue that the final app binary is *more than 50MB* when >>> using Pandoc library. It?s around 5MB for simple haskell library. And >>> without using Haskell, it?s around 100kb. >>> >>> Is it possible to strip the executable binary? I read that stripping is >>> not possible using xcode strip. I also try to add -split-objs flag, but >>> it?s not working either. >>> >>> Any idea? Is this a known issue? >>> >>> Thanks for making Haskell work on iOS! >>> >>> Best regards and merry christmas, >>> Joe >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Dec 25 16:18:37 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 25 Dec 2013 11:18:37 -0500 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Message-ID: It occurs to me: did you start with a wiped package db when you tried split objects? Each lib needs to be built with split objects for it to be usable. (Though it also sounds like you're hitting some funny problems I had when trying to build pandoc with split objects a while ago ). Even if you get split objects working, be forearmed that it could seriously blow up compilation times! On Wednesday, December 25, 2013, Carter Schonwald wrote: > Woah! Jumping into cross compiling as your way to start learning Haskell? > That's pretty awesome. Please continue to share any problems you may > have, it's always possible that it could be a bug! > > On Wednesday, December 25, 2013, Joe wrote: > >> Hi Carter, >> >> Sure! Just added new ticket #8629 >> . >> >> As for inlining, I think i?ll start learning haskell first before jumping >> into modifying the code :). Hopefully either split-objs, executable or >> other some other idea to reduce binary size could be found very soon. >> >> Thanks for helping. >> >> Best regards, >> Joe >> >> On Dec 25, 2013, at 10:14 PM, Carter Schonwald < >> carter.schonwald at gmail.com> wrote: >> >> Huh. Could you write up a ticket on trac? This could be considered a >> bug in cross compilation. Explain that you're trying to make sure the >> object code for iOS is small. >> >> @luke, are there any tricks for managing object size you've done >> >> There are some ideas to reduce object size for ghc 7.10, but that doesn't >> help you write now. >> >> >> @Joe: one idea could be to mess with the ghc flags that relate to >> Inlining. Reducing the amount of Inlining may help with object size, BUT >> may make things slower. I don't recall what the relevant ghc flags are off >> hand. You'd have to do some digging. >> >> >> >> On Wednesday, December 25, 2013, Joe wrote: >> >>> Hi Carter, >>> >>> When I have added ?split-objs: True? in .cabal/config file, but when >>> running cabal I got this message: >>> >>> Preprocessing library pandoc-1.12.2.1... >>> unused terminals: 1 >>> >>> on the commandline: Warning: ignoring -fsplit-objs >>> >>> And if I ignore that, at the end of build, I get another error message >>> that stop the build. >>> >>> cabal: dist-i386/build/Text/Pandoc_o_split: does not exist >>> >>> It seems that split-objs cannot work with cross-compilation ghc. >>> >>> What do you think? >>> >>> Best regards, >>> Joe >>> >>> On Dec 25, 2013, at 8:46 PM, Carter Schonwald < >>> carter.schonwald at gmail.com> wrote: >>> >>> You need to make sure every lib is built with split objs, not just the >>> final application. Did you try it that way? You could also try to limit >>> the amount of Inlining in your application too >>> >>> On Wednesday, December 25, 2013, Joe wrote: >>> >>>> Hi, >>>> >>>> I?m asking similar question on haskell-cafe group, but I think it?s >>>> more appropriate to ask here since it?s iPhone related. Please forgive my >>>> double post. >>>> >>>> I have been trying to statically link Pandoc packages to iOS >>>> application and I want to say that what have been done so far as explained >>>> in https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is >>>> great! I have finally successfully use Pandoc library in iOS app, but >>>> there?s an issue that the final app binary is *more than 50MB* when >>>> using Pandoc library. It?s around 5MB for simple haskell library. And >>>> without using Haskell, it?s around 100kb. >>>> >>>> Is it possible to strip the executable binary? I read that stripping is >>>> not possible using xcode strip. I also try to add -split-objs flag, but >>>> it?s not working either. >>>> >>>> Any idea? Is this a known issue? >>>> >>>> Thanks for making Haskell work on iOS! >>>> >>>> Best regards and merry christmas, >>>> Joe >>>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at interare.com Wed Dec 25 16:18:38 2013 From: joe at interare.com (Joe) Date: Wed, 25 Dec 2013 23:18:38 +0700 Subject: [Haskell-iPhone] Fat binaries on iOS Target In-Reply-To: References: <9FCE5BC8-7F71-41BD-8D81-7C968FD34468@interare.com> <2A94FA50-1BE1-49E2-B91B-614E358F0834@interare.com> Message-ID: Sure! Thanks for your encouragement. Best regards, Joe On Dec 25, 2013, at 11:14 PM, Carter Schonwald wrote: > Woah! Jumping into cross compiling as your way to start learning Haskell? That's pretty awesome. Please continue to share any problems you may have, it's always possible that it could be a bug! > > On Wednesday, December 25, 2013, Joe wrote: > Hi Carter, > > Sure! Just added new ticket #8629. > > As for inlining, I think i?ll start learning haskell first before jumping into modifying the code :). Hopefully either split-objs, executable or other some other idea to reduce binary size could be found very soon. > > Thanks for helping. > > Best regards, > Joe > > On Dec 25, 2013, at 10:14 PM, Carter Schonwald wrote: > >> Huh. Could you write up a ticket on trac? This could be considered a bug in cross compilation. Explain that you're trying to make sure the object code for iOS is small. >> >> @luke, are there any tricks for managing object size you've done >> >> There are some ideas to reduce object size for ghc 7.10, but that doesn't help you write now. >> >> >> @Joe: one idea could be to mess with the ghc flags that relate to Inlining. Reducing the amount of Inlining may help with object size, BUT may make things slower. I don't recall what the relevant ghc flags are off hand. You'd have to do some digging. >> >> >> >> On Wednesday, December 25, 2013, Joe wrote: >> Hi Carter, >> >> When I have added ?split-objs: True? in .cabal/config file, but when running cabal I got this message: >> >> Preprocessing library pandoc-1.12.2.1... >> unused terminals: 1 >> >> on the commandline: Warning: ignoring -fsplit-objs >> >> And if I ignore that, at the end of build, I get another error message that stop the build. >> >> cabal: dist-i386/build/Text/Pandoc_o_split: does not exist >> >> It seems that split-objs cannot work with cross-compilation ghc. >> >> What do you think? >> >> Best regards, >> Joe >> >> On Dec 25, 2013, at 8:46 PM, Carter Schonwald wrote: >> >>> You need to make sure every lib is built with split objs, not just the final application. Did you try it that way? You could also try to limit the amount of Inlining in your application too >>> >>> On Wednesday, December 25, 2013, Joe wrote: >>> Hi, >>> >>> I?m asking similar question on haskell-cafe group, but I think it?s more appropriate to ask here since it?s iPhone related. Please forgive my double post. >>> >>> I have been trying to statically link Pandoc packages to iOS application and I want to say that what have been done so far as explained in https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling/iOS is great! I have finally successfully use Pandoc library in iOS app, but there?s an issue that the final app binary is more than 50MB when using Pandoc library. It?s around 5MB for simple haskell library. And without using Haskell, it?s around 100kb. >>> >>> Is it possible to strip the executable binary? I read that stripping is not possible using xcode strip. I also try to add -split-objs flag, but it?s not working either. >>> >>> Any idea? Is this a known issue? >>> >>> Thanks for making Haskell work on iOS! >>> >>> Best regards and merry christmas, >>> Joe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: