[swift-dev] [SR-40] Port Swift to Arm progress / question

Dmitri Gribenko gribozavr at gmail.com
Wed Dec 9 21:14:46 CST 2015


On Wed, Dec 9, 2015 at 7:05 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Wed, Dec 9, 2015 at 3:05 PM, William Dillon via swift-dev
> <swift-dev at swift.org> wrote:
>> Nick was correct in noting that __muloti4 wasn’t needed on 32-bit platforms.  I added another case to the preprocessor conditional for __muloti4, and specified __arm__ and __linux__ for mulodi4.  The __multi3 and __divti3 references went away.
>>
>> Then, I went on to the module.map file for bringing in the Glibc headers.  I’m trying to think of a way to either remove the architecture specific paths to many of those libraries (they’re now x86_64-linux-gnu, but need to be arm-linux-gnueabihf for arm).  I read the modules documentation at http://clang.llvm.org/docs/Modules.html and it doesn’t look like it’s possible to have conditionals in there.  I’m considering whether it’s a good idea to preprocess that file in some way to fill them out with the correct paths in the build scripts.  I went ahead and changed them all (breaking x86_64 for the time being).
>
> Did you try https://github.com/apple/swift/pull/282 ?
>
>> At this point, the compiler and standard library are all built, and I think I have one final issue.  In the testing suite, the binaries generated by the swift compiler don’t run.  They’re emitting unexpected reloc type errors.  It appears that reolc type 0x03 is R_ARM_REL32 which is not permitted for use with shared libraries:
>>
>> CollectionOfOne.swift.tmp/a.out: error while loading shared libraries: /home/wdillon/build/Ninja-ReleaseAssert/swift-linux-armv7/lib/swift/linux/libswiftCore.so: unexpected reloc type 0x03
>>
>> This also happens with small example swift programs that I’ve written for testing.
>
> +John for this error.

It would be also helpful if you could find which code contains these
relocations.  Try 'objdump -R libswiftCore.so' or 'readelf -r'.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-dev mailing list