A version of Swift (3.1) is already on HaikuDepot but only for x86_64.
I’m currently testing 4.2 and will update the port when it is ready.
A version of Swift (3.1) is already on HaikuDepot but only for x86_64.
I’m currently testing 4.2 and will update the port when it is ready.
Is it has continue ?
No cmark found
I have already have 4.2 ported and tested but that is too old and a lot has changed since then. Instead I’m focused on the latest version, but I’m quite busy with other things. Thus, I can only suggest ‘patches welcome’ unless I have more time to look at this.
Nice to hear it… When you have get a lot free time, tell me please how to build it or how I can help you to port something in future
So… I tried to build swift-4.2.2-release from scratch with your scripts
All good but:
Could you help me when you can ?)
I found some strange behaviour:
But my Haiku use clang-9
Reinstall llvm_clang to 6.x didn’t help me The main trouble contains in vasprintf / asprintf. I read other sources and found that trouble present on OpenBSD also, and depend on POSIX standard version.
Are you on hrev54818 or newer? If not you could try to update.
haiku_devel-r1~beta2_hrev54858-1-x86_64.hpkg today It did not help
No vasprintf in headers here, this path is linked when build app
But, there is vasprintf is presented:
Add the features to your ported implementation, if the features are not publically exposed by the OS. Don’t tap into the private OS headers…
But it is clearly there in /bsd/stdio.h which is not private.
Read /bsd/stdio.h, you will see it is guarded by ifdefs:
#if defined(_DEFAULT_SOURCE) || defined(_GNU_SOURCE)
... blabla ...
Pass / define _BSD_SOURCE
.
Of course I don’t change anything inside system…
@extrowerk: I found GNU_SOURCE everywhere there
And while code build, stdio.h used from /boot/system/develop/headers/posix/stdio.h :)))
Ok, I think it not available now to build GNU_SOURCEd apps which have vasfprintf functions inside.
korli also added _SC_TTY_NAME_MAX to the supported sysconf parameters, added tcgetsid, fixed the definition of in6_addr, improved strace output for termios ioctls, and relaxed some checks in handling of network ioctls to fix incompatibilities with old OpenJDK versions. He also fixed handling of O_APPEND, added aligned_alloc (as specified in C11), made fsync() return EINVAL on fifos, and moved asprintf and vasprintf to BSD extensions as they are not part of POSIX.
From one side it is right, and this BSD/GNU parts of code… but other side gnulib is not supported by Haiku :))
As extrowerk said, you just need to set the correct compile flag. That is add -D_DEFAULT_SOURCE to your compiler flags, and -lbsd to your linker flags. No need for gnulib or anything like that.
Thank you so much
-DCMAKE_C_FLAGS="-D_DEFAULT_SOURCE -fPIC"
-DCMAKE_CXX_FLAGS="-D_DEFAULT_SOURCE -fPIC"
-DCMAKE_EXE_LINKER_FLAGS=-lbsd