Skip to content

[SR-1836] Several test/Reflection tests fail on Android due to a linker error #44445

@modocache

Description

@modocache
mannequin
Previous ID SR-1836
Radar None
Original Reporter @modocache
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Android, StarterBug
Assignee None
Priority Medium

md5: 1e33b0f1fb1aa59090ef0955a4dc2c95

Issue Description:

The following reflection tests fail when run against an Android target:

  • test/Reflection/box_descriptors.sil

  • test/Reflection/capture_descriptors.sil

  • test/Reflection/typeref_decoding.swift

  • test/Reflection/typeref_decoding_imported.swift

  • test/Reflection/typeref_lowering.swift

All of them use swift-reflection-dump, and all of them fail with the following message:

/usr/bin/ld.gold: fatal error: -shared and -pie are incompatible
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

I think these tests pass on Linux targets that use the gold linker. Perhaps we need to modify the %target-swift-reflection-dump substitution on Android?

Prerequisites:

  • An Ubuntu 15.10 development environment capable of building Swift from source.

  • A physical Android device.

Helpful skills:
Familiarity with Python and llvm-lit would be helpful, but not strictly necessary.

Starting point:

  1. Follow the instructions in docs/Android.md to build and run the test suite on a physical Android device. Confirm this test still fails.

  2. Take a look at the %target-swift-reflection-dump substitution on Android: https://github.com/apple/swift/blob/add621a959f14107338e55d4bf14407d9b7848f4/test/lit.cfg#L952-L953 – maybe these need to be changed for Android? Or perhaps some other substitution in that file is passing bad linker flags?

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidPlatform: AndroidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions