Dear colleagues
I have faced with strange behaviour, when I compile some swift source on Ubuntu 14, target=arm-linux-gnueabi, all neccessary modules for arm present, -sysroot and
-isysroot are passed via -Xcc.
<module-includes>:61:10: note: in file included from <module-includes>:61: #include "/usr/include/x86_64-linux-gnu/sys/wait.h"
^
/usr/include/x86_64-linux-gnu/sys/wait.h:148:20: error: unknown type name 'idtype_t'
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
^
<unknown>:0: error: could not build Objective-C module 'SwiftGlibc'
Arm 32-bit pcm for SwiftShims was build successfully, but SwiftGlibc after it is not. Is it true, that compiler generates include-directive with path, starting from "/usr/include/x86_64-linux-gnu", that is on native host? What arguments I have to point out for swiftc to avoid such situation? But if that is true, and swiftc needs some headers on native host, I will looking for idtype_t definition. What do you think?
You need a different variant of the module map for Glibc that
references the arm triple.
Dmitri
···
On Thu, Mar 24, 2016 at 1:30 PM, Труб Илья <swift-dev@swift.org> wrote:
Dear colleagues
I have faced with strange behaviour, when I compile some swift source on Ubuntu 14, target=arm-linux-gnueabi, all neccessary modules for arm present, -sysroot and
-isysroot are passed via -Xcc.
<module-includes>:61:10: note: in file included from <module-includes>:61: #include "/usr/include/x86_64-linux-gnu/sys/wait.h"
^
/usr/include/x86_64-linux-gnu/sys/wait.h:148:20: error: unknown type name 'idtype_t'
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
^
<unknown>:0: error: could not build Objective-C module 'SwiftGlibc'
On Thu, Mar 24, 2016 at 1:30 PM, ���� ���� <swift-dev@swift.org> wrote:
�Dear colleagues
�I have faced with strange behaviour, when I compile some swift source on Ubuntu 14, target=arm-linux-gnueabi, all neccessary modules for arm present, -sysroot and
�-isysroot are passed via -Xcc.
�<module-includes>:61:10: note: in file included from <module-includes>:61:
�#include "/usr/include/x86_64-linux-gnu/sys/wait.h"
����������^
�/usr/include/x86_64-linux-gnu/sys/wait.h:148:20: error: unknown type name 'idtype_t'
�extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
��������������������^
�<unknown>:0: error: could not build Objective-C module 'SwiftGlibc'
You need a different variant of the module map for Glibc that
references the arm triple.
Yes, Dmitry. I found corresponding module.map for arm and placed it into glibs subdirectory of my swiftc's include path. It was found. But, it seems to me, sysroot argument is not applied to paths, written in that module.map or I do not how to correct do that.
I add to swift command-line following option:
-Xcc "-sysroot <msysroot>", but now I get error:
<my swift include path>/glibc/module.map:187:14: error: header '/usr/include/sys/ioctl.h' not found
header "/usr/include/sys/ioctl.h"
^
<unknown>:0: error: could not build Objective-C module 'SwiftGlibc'
I checked, that file <mysysroot>/usr/include/sys/ioctl.h actually exists. Could you hint, what I do wrong?
It seems to me, the last phenomena is explained by swift compiler bug. Let us look into clang/lib/Lex/ModuleMap.cpp source file, method parseHeaderDecl. We can find, for example, following lines:
if (llvm::sys::path::is_absolute(Header.FileName)) {
RelativePathName = Header.FileName;
File = SourceMgr.getFileManager().getFile(RelativePathName);
}
We can see, that sysroot (or isysroot) argument is ignored. What can you say about that?
···
25.03.2016, 12:21, "���� ���� via swift-dev" <swift-dev@swift.org>:
Yes, Dmitry. I found corresponding module.map for arm and placed it into glibs subdirectory of my swiftc's include path. It was found. But, it seems to me, sysroot argument is not applied to paths, written in that module.map or I do not how to correct do that.
I add to swift command-line following option:
-Xcc "-sysroot <msysroot>", but now I get error:
<my swift include path>/glibc/module.map:187:14: error: header '/usr/include/sys/ioctl.h' not found
������header "/usr/include/sys/ioctl.h"
�������������^
<unknown>:0: error: could not build Objective-C module 'SwiftGlibc'
I checked, that file <mysysroot>/usr/include/sys/ioctl.h actually exists. Could you hint, what I do wrong?