> On Apr 29, 2016, at 23:46, Karl Wagner via swift-dev <swift-dev@swift.org> 
> wrote:
> 
>> 
>> On 22 Apr 2016, at 06:46, Timothy Wood <t...@omnigroup.com 
>> <mailto:t...@omnigroup.com>> wrote:
>> 
>> 
>>> On Apr 19, 2016, at 1:57 AM, Karl Wagner via swift-dev <swift-dev@swift.org 
>>> <mailto:swift-dev@swift.org>> wrote:
>>> 
>>> I’m trying to cross-compile Swift for the Raspberry Pi. I’ve got the tools 
>>> and most of the standard library compiling, but I’m getting stuck trying to 
>>> build the platform components for Glibc. Swift is just complaining that the 
>>> “SwiftGlibc” module doesn’t exist. I’d appreciate it if anybody could help 
>>> trying to find out why.
>>> 
>>> I’ve been whittling down at the compile command, trying to figure out why 
>>> it isn’t finding/building the module.
>> 
>> In this message <http://article.gmane.org/gmane.comp.lang.swift.devel/1710 
>> <http://article.gmane.org/gmane.comp.lang.swift.devel/1710>> there was a 
>> suggestion to make a symlink to work around this issue (but when building on 
>> Ubuntu x86_64, I think). Perhaps something similar would work?
>> 
>> What steps are you using to get as far as you have? I’m not having a lot of 
>> luck so far…
>> 
>> -tim
>> 
> 
> 
> Well that seems to be trying to resolve the runtime issue; I’m still trying 
> to compile the standard library.
> 
> My changes are here: https://github.com/karwa/swift 
> <https://github.com/karwa/swift>
> 
> Then I’m building with:
> 
> ../swift/utils/build-script -d \
>       --install-prefix="/usr" \
>       --install-symroot="${cc_files}/out/symroot" \
>       -- \
>       --cross-compile-tools-deployment-targets=linux-armv7 \
>       --cross-compile-sysroot="${sysroot}" \
>       --cross-compile-toolchain-bin="${toolchain}"
>       --stdlib-deployment-targets="macosx-x86_64;linux-armv7=linux-armv7”
> 
> (I’m not sure about the install arguments; I’ve only been building for OSX, 
> so I’ve never ‘installed’ a built swift besides Xcode toolchains.)
> 
> This builds for the host first, then uses the freshly baked clang and swift 
> compilers to cross-compile to the target. I can compile the tools and what I 
> believe is most of the standard library; it just flops at SwiftGlibc and I 
> can’t understand it because glibc.modulemap exists where it should and looks 
> good (headers pointing inside the cross-compiled sysroot). It’s not even 
> complaining about the modulemap itself (like missing headers or whatever); it 
> just appears unable to find it even though it’s in the swift compiler’s 
> include path.
> 
> Is there some kind of extra flag to tell it to look inside that particular 
> modulemap file, that perhaps isn’t being generated for me? I don’t know how 
> that magic works, how Swift knows what to look for when it sees:
> 
> @_exported import SwiftGlibc
> 
> inside public/Platform/Glibc.swift

The logic to go look for that file is hardcoded in the compiler; it’s not 
picked up via include paths. It has to specifically be inside the lib/swift/ 
directory. (I think it’s at lib/swift/linux/, but I’m not 100% sure.)

Jordan

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to