Open gonzalolarralde opened 8 years ago
I think it worths to be said that the exact same codebase checked out at the same time in a x86_64 linux 16.04 emulator worked fine. This seems to be an arm
only issue.
Comment by Neon (JIRA)
I just learned that arm aarch64 != apple arm64.
The arm aarch64 ABI defines __va_list as:
struct __va_list
{
void *__stack;
void *__gr_top;
void *__vr_top;
int __gr_offs;
int __vr_offs;
};
but for apple arm64 it is char*.
Is it possible that swift is only working with apple arm64 but clang has arm aarch64 implemented?
Is this issue related to https://bugs.swift.org/browse/SR-3429 ?
@modocache, unlikely that they are related. This would need to work before that can even occur as this issue prevents the definition of `CVaListPointer` entirely.
Partial WIP patch at apple/swift#12623. The ClangImporter still needs adjustment and _VaListBuilder needs to be completed.
The only bit that remains is fixing the _VaListBuilder which seems to not be getting interpreted properly.
We now have a fix for this issue.
This fix has been tested on a variety of arm64/aarch64 devices, from small SBC's like the RaspberryPi and Rock64, to high end Cavium ThunderX servers.
We need this issue resolved urgently as it is blocking successful builds on the new AArch64 CI - https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/
Comment by Ed Vielmetti (JIRA)
@compnerd please take a look? We have a new CI system ready to go, blocked at the moment on this bug.
Environment
OS: Ubuntu 16.04 xenial Kernel: 3.10.65-7-pine64-longsleep \#28 SMP PREEMPT Sat Apr 23 20:13:25 CEST 2016 aarch64 aarch64 aarch64 GNU/Linux CPU: Cortex A53 / ARMv8-A (active state AArch64) @ 1.2Ghz x 4 cores Board: Pine64Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 2 | |Component/s | Compiler | |Labels | Bug, ClangImporter, Linux, aarch64 | |Assignee | @compnerd | |Priority | Medium | md5: 9e146d43940f2f8d25705b8c9685e5fcis duplicated by:
Issue Description:
I'm getting an error when trying to compile
corelibs-foundation
inarm
. When the compile process is done with CoreFoundation and gets to the Swift wrappers, it's failing trying to compileNSString.init(format: String: arguments: CVaListPointer)
and sibling methods.cannot convert value of type 'CVaListPointer' to expected argument type 'va_list' (aka '__va_list')
SR-1412 reported problems when trying to resolve the correct
va_list
inarm
. Based on the error message we're getting, and what was the issue at that time, my theory isswift
project is resolvingva_list
and__va_list
in a different way ascorelibs-foundation
does forarm
's toolchain. Then the mapped types defined here are failing to work:https://github.com/apple/swift/blob/621d3b7c666b92b8078624a8d228e1c123f23bca/lib/ClangImporter/MappedTypes.def#L126-L130
Again, is just a theory, I couldn't prove it yet.
Complete compilation call as executed by the build script with the following parameters:
utils/build-script -R --libdispatch 1 --xctest 1 --foundation 1