[swift-dev] Error with SwiftGlibs building for arm-linux

Труб Илья itrub at yandex.ru
Fri Mar 25 07:47:40 CDT 2016


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 at 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?
>
> 25.03.2016, 01:15, "Dmitri Gribenko" <gribozavr at gmail.com>:
>>  Then you should have a module map for Glibc in the build products.
>>
>>  Dmitri
>>
>>  On Thu, Mar 24, 2016 at 2:32 PM, Труб Илья <itrub at yandex.ru> wrote:
>>>   I have built all targets for arm (including modules and libraries) within the native arm environment on arm-emulator with chroot.
>>>
>>>   25.03.2016, 00:25, "Dmitri Gribenko" <gribozavr at gmail.com>:
>>>>   On Thu, Mar 24, 2016 at 2:03 PM, Труб Илья <itrub at yandex.ru> wrote:
>>>>>    Thanks for your answer, Dmitry. I will look for examples of module maps in test sources.
>>>>
>>>>   You shouldn't need to. If you have built Swift for arm, you should
>>>>   have the right one produced by the build system.
>>>>
>>>>   How did you compile the standard library for arm?
>>>>
>>>>   Dmitri
>>>>
>>>>   --
>>>>   main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
>>>>   (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>>
>>  --
>>  main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
>>  (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev


More information about the swift-dev mailing list