You are not logged in.

#1 2016-01-11 17:02:47

rlovelett
Member
Registered: 2016-01-11
Posts: 7

Makepkg fails while manual succeeds

I'm trying to make a package (PKGBUILD) of something I've (successfully) been building from source. Unfortunately when I run the commands manually the build succeeds but when I run the same commands inside of package build it fails to link. This leads me to believe there is a fundamental difference between the makepkg build and my manual build that I am obviously not understanding.

I've searched for a few days, to no-avail, to determine what could be different between the manual and makpkg build. As a "newbie" to Arch and making my own packages this seems like the right place to post but I'll be happy to re-post/move the thread elsewhere if this is the wrong place.

Offline

#2 2016-01-11 17:06:48

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,865
Website

Re: Makepkg fails while manual succeeds

What message do you get when the build fails? Post the PKGBUILD you have so far.

Mod note: Moving to Creating & Modifying Packages


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-01-11 17:36:10

rlovelett
Member
Registered: 2016-01-11
Posts: 7

Re: Makepkg fails while manual succeeds

Sure. The full failing build log can be found in this Gist and the PKGBUILD (with necessary patches) can be found here.

The summary of the build failure is:

FAILED: : && /usr/bin/clang++  -fPIC -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 -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -O3  -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-z,defs   -target x86_64-unknown-linux-gnu -isysroot / -lpthread -ldl -Xlinker -T -Xlinker /home/jenkins/workspace/swift/src/build/buildbot_linux/swift-linux-x86_64/./lib/swift/linux/x86_64/swift.ld  -L/home/jenkins/workspace/swift/src/build/buildbot_linux/swift-linux-x86_64/./lib/swift/linux/x86_64 -L/home/jenkins/workspace/swift/src/build/buildbot_linux/swift-linux-x86_64/./bin/../lib/swift/linux/x86_64 -L/home/jenkins/workspace/swift/src/build/buildbot_linux/swift-linux-x86_64/./bin/../lib/swift/linux -shared -Wl,-soname,libswiftCore.so -o lib/swift/linux/x86_64/libswiftCore.so stdlib/public/core/linux/x86_64/Swift.o -L/home/jenkins/workspace/swift/src/build/buildbot_linux/llvm-linux-x86_64/lib  -L/home/jenkins/workspace/swift/src/build/buildbot_linux/llvm-linux-x86_64/./lib lib/swift/linux/x86_64/libswiftRuntime.a lib/swift/linux/x86_64/libswiftStdlibStubs.a -licuuc -licui18n -lbsd -Wl,-rpath,"\$ORIGIN:/usr/lib/swift/linux" && :
lib/swift/linux/x86_64/libswiftRuntime.a(Casting.cpp.o): In function `swift_getTypeName':
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/Casting.cpp:(.text.swift_getTypeName+0xd8): undefined reference to `pthread_rwlock_rdlock'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/Casting.cpp:(.text.swift_getTypeName+0x15f): undefined reference to `pthread_rwlock_unlock'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/Casting.cpp:(.text.swift_getTypeName+0x167): undefined reference to `pthread_rwlock_wrlock'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/Casting.cpp:(.text.swift_getTypeName+0x1ef): undefined reference to `pthread_rwlock_unlock'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/Casting.cpp:(.text.swift_getTypeName+0x30b): undefined reference to `pthread_rwlock_unlock'
lib/swift/linux/x86_64/libswiftRuntime.a(ProtocolConformance.cpp.o): In function `_addImageProtocolConformances(dl_phdr_info*, unsigned long, void*)':
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/ProtocolConformance.cpp:(.text._ZL29_addImageProtocolConformancesP12dl_phdr_infomPv+0x1e): undefined reference to `dlopen'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/ProtocolConformance.cpp:(.text._ZL29_addImageProtocolConformancesP12dl_phdr_infomPv+0x30): undefined reference to `dlsym'
/home/jenkins/workspace/swift/src/swift/stdlib/public/runtime/ProtocolConformance.cpp:(.text._ZL29_addImageProtocolConformancesP12dl_phdr_infomPv+0x58): undefined reference to `dlclose'
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)

My "manual" build commands look like this:

$ makepkg --nobuild
$ cd src/swift
$ pkgver=$(git describe --long --tags | sed -r 's/swift-([0-9]+\.[0-9]+)-SNAPSHOT-([0-9]+)-([0-9]+)-([0-9]+)-([a-z]+)-([0-9]+)/\1.\2\3\4\5.r\6/g;s/-/./g')
$ cd -
$ installable_package="$(readlink -f ./src/../swift-${pkgver}.tar.xz)"
$ cd src/swift
$ utils/build-script --preset=buildbot_arch_linux installable_package="${installable_package}" install_destdir=/tmp

My makpkg build commands look like this:

$ makepkg -sr --nodeps

Offline

#4 2016-01-12 14:47:12

rlovelett
Member
Registered: 2016-01-11
Posts: 7

Re: Makepkg fails while manual succeeds

I think I've found the root of the problem and it is the default LDFLAGS provided by /etc/makepkg.conf. Specifically the "-Wl,-01,--sort-common,--as-needed,-z,relro". I think the as needed part is causing somethings not to link appropriately. This is likely a bug in the compilation settings of the upstream package.

For now the work around is just to unset the default LDFLAGS.

Offline

Board footer

Powered by FluxBB