Re: clang++ and a modern C++ library

2014-12-08 Thread Dave Huseby
 I tried with llvm-3.5.20140228p18 (the clang package), g++-4.9.2 and
 libstdc++-4.8.3, the next command:
 
 clang++ -std=c++11 -I/usr/local/include -I/usr/local/include/c++/4.9.2
 -I/usr/local/include/c++/4.9.2/x86_64-unknown-openbsd5.6 -I/usr/include
 -L/usr/local/lib/gcc-lib/amd64-unknown-openbsd5.6/3.3.6 -L/usr/local/lib
 -nostdinc++ -lestdc++ test.cc
 
 Apparently everything works fine.

Alright, let me update my scripts and give this a shot.

--dave



clang++ and a modern C++ library

2014-11-30 Thread Dave Huseby
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Status update...

I've been working on porting Rust over to OpenBSD by building a Rust
cross-compiler for Linux that can target i386-unknown-openbsd and
x86_64-unknown-openbsd.  The largest roadblock on OpenBSD is the lack
of a more recent GNU linker (ld).  I have tried the 2.17 linker in the
source tree and it doesn't work.  To catch everybody up, the rust
compiler is built on LLVM and uses C++1x which requires a newer
compiler.  I started by using 4.8.3 on OpenBSD but the old linker
isn't working.

Somebody suggested using clang on OpenBSD, but it appears that the
port for clang++ doesn't include libc++.  Is that correct?  So clang++
doesn't have a new enough standard C++ library to do the job.  I've
tried using clang++ with the libstdc++ that is part of the gcc 4.8.3
port but I can't seem to figure out the magic set of parameters to
clang++ to make it select the newer libstdc++ that is part of the gcc
4.8.3 port.

I'm starting to think that this may not be possible without some
catching up on toolchains for OpenBSD.  And given the conservative
nature of OpenBSD, it may be some time before the toolchains are
modern enough to compile and link the Rust compiler.

- --dave
-BEGIN PGP SIGNATURE-

iF4EAREIAAYFAlR7qwoACgkQvt/JvmUQuOmMmQD+KpYTqyiNJJBoZos7+CQnOTG4
XmsrUbU8lPtOGM9kBCoA/j7e+Ghe+1hHOqBNFZlyj9cx6AfWDjN30dJ/5vNvjoED
=eufW
-END PGP SIGNATURE-


0x6510B8E9.asc
Description: application/pgp-keys


0x6510B8E9.asc.sig
Description: PGP signature


Status on porting Rust to OpenBSD

2014-11-20 Thread Dave Huseby
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi everybody,

In my free time over the last few weeks I have been attempting to
cross-compile the rust compiler using the same method that was used to
add support for Dragonfly BSD.  I started with the scripts from the
Dragonfly effort and fixed them up to work with OpenBSD and Linux.
All of my code and documentation is here:

https://github.com/dhuseby/rust-cross-openbsd

Currently, I'm stuck on stage 3.  The part where all of the object
files from both OpenBSD and Linux need to be linked together into an
OpenBSD executable.  I'm pretty certain the reason stage 3 doesn't
complete is because of the old linker on OpenBSD.  At the bottom of
the README.md file I discuss some options on what to try next.  I have
also included build logs of all stages so that other people can see
the output without jumping through all of the hoops I did.

My options at this point are this:

1. Use the same version compiler/assembler/linker on Linux and OpenBSD
so that the object files will be more compatible.  Hopefully this will
allow stage 3 to finish linking.

2. Apply my OpenBSD target patches to Rust and build a Linux rust
compiler that knows how to target OpenBSD.  Then I use Linux emulation
on OpenBSD to run it to compile itself from scratch.

3. Figure out a way to get a newer linker working on OpenBSD.

Thoughts?  I'm looking for feedback.  Are my assumptions and ideas
right for why stage 3 doesn't successfully link?  Any other ideas on
what I can try?

- --dave
-BEGIN PGP SIGNATURE-

iF4EAREIAAYFAlRtZBMACgkQvt/JvmUQuOkWZgD+PWr5ZmE6ypdQQuLgo1eHddGl
e0LUUJi8CyvYpyNqUEMA/1EJCC6Z6mCeM11oGKhHxLdChv3qVjKg/6jXAoEIPynh
=GD3X
-END PGP SIGNATURE-


0x6510B8E9.asc
Description: application/pgp-keys


0x6510B8E9.asc.sig
Description: PGP signature