On Sun, Nov 30, 2014 at 03:40:58PM -0800, Dave Huseby wrote:
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.
Disclaimer: I know nothing about c++ :)
I used this program to test clang and c++11 (extracted from
https://solarianprogrammer.com/2013/01/17/building-clang-libcpp-ubuntu-linux/ ):
//Program to test the new C++11 regular expressions syntax
#include iostream
#include regex
#include string
using namespace std;
int main()
{
string input;
regex
rr(((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?);
//As long as the input is correct ask for another number
while(true)
{
coutGive me a real number!endl;
cininput;
if(!cin) break;
//Exit when the user inputs q
if(input==q)
break;
if(regex_match(input,rr))
coutfloatendl;
else
{
coutInvalid inputendl;
}
}
}
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.
--
Juan Francisco Cantero Hurtado http://juanfra.info