[swift-dev] Building Foundation on FreeBSD

Davide Italiano dccitaliano at gmail.com
Fri Dec 18 06:58:17 CST 2015


On Wed, Dec 16, 2015 at 2:25 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>
>> On Dec 16, 2015, at 11:21 , Davide Italiano <dccitaliano at gmail.com> wrote:
>>
>> On Wed, Dec 16, 2015 at 11:17 AM, Jordan Rose <jordan_rose at apple.com> wrote:
>>> What's the compile command for the files that are failing? If the target triple there doesn't include a version number, it might be defaulting to something like "1.0".
>>>
>>> Jordan
>>>
>>
>> I see many of these, here's an example:
>> http://people.freebsd.org/~davide/swift/modules_failure.txt
>>
>> BTW, the triple includes a version number (freebsd-unknown-11.0)
>
> Ah, not the one I see: "-target x86_64-unknown-freebsd". Try adding "11.0" to that. (Presumably it comes from the Foundation build script, so you might have to find where it's being passed down.)

Thanks!
I followed your suggestion and I was able to make progress.
While we're at this -- I had another issue with modules (when running
testsuite) that I wasn't able to solve (and which causes a lot of test
failures because Objective-C modules can't be build), i.e. missing
headers.

Command Output (stderr):
--
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/usr/include/complex.h"
         ^
/usr/include/complex.h:32:10: error: 'sys/cdefs.h' file not found with
<angled> include; use "quotes" instead
#include <sys/cdefs.h>
         ^
<module-includes>:2:10: note: in file included from <module-includes>:2:
#include "/usr/include/ctype.h"
         ^
/usr/include/ctype.h:44:10: error: 'sys/cdefs.h' file not found with
<angled> include; use "quotes" instead
#include <sys/cdefs.h>
         ^
[...]

I patched the module map to add those headers, i.e.:

+      module cdefs {
+        header "@GLIBC_ARCH_INCLUDE_PATH@/sys/cdefs.h"
+        export *
+      }
+      module _types {
+        header "@GLIBC_ARCH_INCLUDE_PATH@/sys/_types.h"
+        export *
+      }

but it seems they're not still picked correctly. I also tried to change
<> into "" but, no luck (I also very dislike this approach because I think
system headers shouldn't be modified to get this to work). Any
ideas on what can be wrong/I'm missing?

Thanks,

--
Davide


More information about the swift-dev mailing list