Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-4147] swift-reflection-dump error while building swift #46730

Closed
swift-ci opened this issue Mar 3, 2017 · 10 comments
Closed

[SR-4147] swift-reflection-dump error while building swift #46730

swift-ci opened this issue Mar 3, 2017 · 10 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Mar 3, 2017

Previous ID SR-4147
Radar None
Original Reporter amraboelela (JIRA User)
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 2fef1f4f105584e34edd12a54932047d

Issue Description:

[691/779] Linking CXX executable bin/swift-reflection-dump
FAILED: bin/swift-reflection-dump
: && /usr/bin/clang++ -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -O3 -L/home/amr/swift/build/buildbot_linux/swift-linux-x86_64/./lib/swift/linux -target x86_64-unknown-linux-gnu -lpthread -latomic -ldl -fuse-ld=gold tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o -o bin/swift-reflection-dump -L/home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/./lib -lswiftReflection /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMObject.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMSupport.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMBitReader.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMCore.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMMCParser.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMMC.a /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lz -lm /home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/lib/libLLVMDemangle.a -Wl,-rpath,/home/amr/swift/build/buildbot_linux/llvm-linux-x86_64/./lib && :
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/home/amr/swift/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoderswift::reflection::TypeRefBuilder::decodeMangledType(swift::Demangle::Node* const&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/home/amr/swift/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoderswift::reflection::TypeRefBuilder::decodeMangledType(swift::Demangle::Node* const&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/home/amr/swift/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoderswift::reflection::TypeRefBuilder::decodeMangledNominalType(swift::Demangle::Node* const&, llvm::Optional<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >&, swift::reflection::TypeRef const*&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 3, 2017

Comment by Hugh Bellamy (JIRA)

What version of the compiler are you running? Can you rebase to the latest master and see if the issue still occurs

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 3, 2017

Comment by Amr Aboelela (JIRA)

I used master brach, and still getting same error. The script I am running is:
./swift/utils/build-toolchain local.swift

And I am in Linux environment, and here is the expanding running script:

========== Running script ==========
./utils/build-script: note: using preset 'buildbot_linux', which expands to

./utils/build-script --assertions --no-swift-stdlib-assertions --llbuild --swiftpm --xctest --build-subdir=buildbot_linux --lldb --release --test --validation-test --long-test --foundation --libdispatch --lit-args=-v -- --swift-enable-ast-verifier=0 --build-ninja --install-swift --install-lldb --install-llbuild --install-swiftpm --install-xctest --install-prefix=/usr '--swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license' --build-swift-static-stdlib --build-swift-static-sdk-overlay --build-swift-stdlib-unittest-extra --test-installable-package --install-destdir=/home/amr/swift/swift/swift-nightly-install --installable-package=/home/amr/swift/swift/swift-LOCAL-2017-03-03-a-osx.tar.gz --install-foundation --install-libdispatch --reconfigure

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 3, 2017

Comment by Amr Aboelela (JIRA)

This is what i got till now:

~/swift/build/buildbot_linux$ du -sh *
2.6M    cmark-linux-x86_64
492K    libdispatch-linux-x86_64
1.5G    llvm-linux-x86_64
21M ninja-build
1.4G    swift-linux-x86_64

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 3, 2017

Comment by Amr Aboelela (JIRA)

I am using Ubuntu 15.10

@belkadan
Copy link
Contributor

@belkadan belkadan commented Mar 6, 2017

cc @eeckstein, @ematejska

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 8, 2017

Comment by Christopher Hatton (JIRA)

I got the same error, Ubuntu 15.10.

My build folder:
user@ubuntu:~/Projects/swift-source/build/Ninja-RelWithDebInfoAssert$ du -sh * 5.1M cmark-linux-x86_64 492K libdispatch-linux-x86_64 24G llvm-linux-x86_64 25G swift-linux-x86_64

I invoked build with build-script -r -t. Is the build folder supposed to occupy ~50GB?

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 8, 2017

Comment by Amr Aboelela (JIRA)

Hi Christopher
Yes exactly like me 🙂
I used Ubuntu 15.10 because they said we need it for Android. And same with me, now I am using Ubuntu 16.04 and it is building fine. So they need to support Ubuntu 16.04 for Android or fix compilation in Ubuntu 15.10

On Mar 8, 2017, at 3:58 AM, Christopher Hatton <christopherhattonuk@gmail.com> wrote:

Hi Amr,

I saw that 4 days ago you experienced the same issue as me, building Swift on Ubuntu 15.10.

I wonder if you found a fix?

Perhaps like me you were using Ubuntu 15.10 because this is specifically instructed, to build Swift for Android, which was my goal.

If no fix is forthcoming I may have to try Android build on Ubuntu 16.04.

Trying these things out seems to take an awful lot of resources and time on my MacBook Pro though![]( Hours of build time and >50GB disk usage)

Best regards,
Chris

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Nov 29, 2017

Comment by Jose Rojas (JIRA)

I encountered this today while building Swift on Ubuntu 16.04 (using a docker container). See the console output for more details.

[3/36] Linking CXX executable bin/swift-reflection-dump
FAILED: : && /usr/bin/clang++ -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3 "-L/swift-source/build/Ninja-ReleaseAssert/swift-linux-x86_64/./lib/swift/linux" -target x86_64-unknown-linux-gnu -lpthread -latomic -ldl -fuse-ld=gold tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o -o bin/swift-reflection-dump -L/swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib -lswiftReflection /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMObject.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMBitReader.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMCore.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMBinaryFormat.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMMCParser.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMMC.a /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lz -lm /swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/lib/libLLVMDemangle.a -Wl,-rpath,/swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/./lib && :
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/swift-source/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoder<swift::reflection::TypeRefBuilder>::decodeMangledType(swift::Demangle::Node* const&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/swift-source/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoder<swift::reflection::TypeRefBuilder>::decodeMangledType(swift::Demangle::Node* const&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
tools/swift-reflection-dump/CMakeFiles/swift-reflection-dump.dir/swift-reflection-dump.cpp.o:/swift-source/swift/tools/swift-reflection-dump/swift-reflection-dump.cpp:function swift::remote::TypeDecoder<swift::reflection::TypeRefBuilder>::decodeMangledNominalType(swift::Demangle::Node* const&, llvm::Optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, swift::reflection::TypeRef const*&): error: undefined reference to 'swift::Demangle::mangleNode(swift::Demangle::Node* const&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
root@ea9f25bc95bf:/swift-source/swift# nm -lA --demangle ../build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux/libswiftReflection.a | grep mangleNode
../build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux/libswiftReflection.a:TypeRefBuilder.cpp.o: U swift::Demangle::mangleNode[abi:cxx11](swift::Demangle::Node* const&) /swift-source/swift/stdlib/public/Reflection/TypeRefBuilder.cpp:0
../build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/linux/libswiftReflection.a:Remangler.cpp.o:0000000000000000 T swift::Demangle::mangleNode[abi:cxx11](swift::Demangle::Node* const&)
root@ea9f25bc95bf:/swift-source/swift# lsb_release -r
Release: 16.04

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Nov 29, 2017

Comment by Jose Rojas (JIRA)

I tried running the command:

./swift/utils/build-toolchain local.swift

And the outcome was the same... undefined symbol error while building 'bin/swift-reflection-dump'.

I'm reopening this issue.

@swift-ci
Copy link
Collaborator Author

@swift-ci swift-ci commented Nov 29, 2017

Comment by Jose Rojas (JIRA)

I double checked my settings and it looks like I had an incompatible version of cmake installed (3.5.2 instead of 3.5.1).

Reverting to the correct version solved the build issue.

Apologies for any spam on this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants