[swift-dev] Compile Error - Arch Linux

Ryan Lovelett swift-dev at ryan.lovelett.me
Sat Dec 5 08:28:21 CST 2015


Dmitri,

Thanks for the extra set of eyes. I have confirmed that moving
'-lpthread -ldl' to either the beginning or end will allow that step to
succeed. The part that I'm stuck on is where that linker argument comes
from in the first place and how to reorder them. Do you happen to have
any insight on that?

For the 'final' package build script I plan to make my own preset for
arch linux that is based on 'mixin_linux_installation'. This is what
'buildbot_linux_1404' and 'buildbot_linux_1510' are based on. I just
want be able to consistently build before I start tweaking parameters.

Again thank you for your suggestions.

On Sat, Dec 5, 2015, at 03:31 AM, Dmitri Gribenko wrote:
> On Fri, Dec 4, 2015 at 6:08 AM, Ryan Lovelett
> <swift-dev at ryan.lovelett.me> wrote:
> > I know that Arch Linux is not a "Supported Target Platforms" so I guess
> > this may be off topic.
> >
> > However, I'm trying to make an PKGBUILD script so that Swift can be
> > installed from the AUR (and perhaps eventually from the main
> > repositories). See: https://github.com/RLovelett/swift-aur
> >
> > For the most part everything is going swimmingly until it goes to link
> > the shared library libswiftCore.so. So as not to clutter up this message
> > with the full log (see attached allout.txt). The germane part is that it
> > is failing to link the references from `pthread_rwlock_rdlock`,
> > `pthread_rwlock_unlock`, `pthread_rwlock_wrlock`, `dlopen`, `dlsym` and
> > `dlclose`. As far as I know they all come from pthreads and dl (e.g.,
> > `-lpthread` and `-ldl`) which can clearly be seen in the failed command
> > as having been sent to clang++.
> >
> > I guess I should also say the command I am using to build is
> > `swift/utils/build-script -R`; though if you want to see all the
> > commands checkout the Github URL above.
> 
> I think the issue is that '-lpthread -ldl' are being specified too
> early on the link line, before the object files.  Could you try
> editing the link command to put '-lpthread -ldl' at the end and
> retrying it in the build directory after the failure?
> 
> For a package build, I would also recommend running the build script
> in preset mode and using the 'buildbot_linux_1404' preset:
> 
> $ ./swift/utils/build-script --preset=buildbot_linux_1404
> installable_package=/tmp/swift.tar.gz
> install_destdir=/tmp/swift-install
> 
> This will build the package the same way as the swift.org packages.
> 
> 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