<div dir="ltr">Hi, Kim.<div><br></div><div>I have the WSL on Windows Preview.</div><div><br></div><div>Could you show the test source/command ?</div><div><br></div><div>-Han Sangjin<br><div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-14 21:10 GMT+09:00 Ryan Lovelett via swift-dev <span dir="ltr"><<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Jun 13, 2016, at 11:33 PM, Dmitri Gribenko via swift-dev wrote:<br>
> On Sat, Jun 11, 2016 at 8:12 AM, 김종수 via swift-dev <<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a>><br>
> wrote:<br>
> > I am testing Swift in "Windows Subsystem for Linux" which is a new feature<br>
> > of Windows 10 Anniversary Update scheduled in this year. WSL is Ubuntu LTS<br>
> > 14.04 compatible in user space.<br>
> ><br>
> > Swift runtime libraries such as libswiftCore.so are marked Executable Stack,<br>
> > which have no problem in Linux.<br>
> ><br>
> > dlopen()'ing swift runtime libraries causes mprotect() with PROT_GROWSDOWN,<br>
> > which is not documented but verified with strace.<br>
> ><br>
> > WSL has not implemented PROT_GROWSDOWN feature because of clean room<br>
> > development.<br>
> ><br>
> > Swift runtime libraries had not been marked Executable Stack before Febrary<br>
> > snapshot. And cmark and llvm/clang shared libraries are not marked too.<br>
> ><br>
> > ***My request is swift runtime libraries be not marked Executable Stack.***<br>
><br>
> Hi,<br>
><br>
> This could have been caused by our switch from the BFD linker to gold.<br>
> Could you try linking a hello world program using gold linker and<br>
> running it in WSL?<br>
<br>
</span>I _think_ this problem existed before the switch from BFD to gold.<br>
<br>
I build and package a version of Swift for Linux. During the package<br>
processes makepkg [1] checks the installed binaries for common gotchas<br>
(I tried looking up exactly what is run but could not find it quickly).<br>
<br>
My point is that I've been seeing:<br>
<br>
swiftc W: ELF file ('usr/bin/swift-test') has executable stack.<br>
swiftc W: ELF file ('usr/bin/repl_swift') has executable stack.<br>
swiftc W: ELF file ('usr/bin/swift-build') has executable stack.<br>
swiftc W: ELF file ('usr/lib/swift/pm/libPackageDescription.so') has<br>
executable stack.<br>
swiftc W: ELF file ('usr/lib/swift/linux/libswiftGlibc.so') has<br>
executable stack.<br>
swiftc W: ELF file ('usr/lib/swift/linux/libXCTest.so') has executable<br>
stack.<br>
swiftc W: ELF file ('usr/lib/swift/linux/libswiftCore.so') has<br>
executable stack.<br>
swiftc W: ELF file ('usr/lib/swift/linux/libFoundation.so') has<br>
executable stack.<br>
<br>
Since at least the 20160208a release, but probably longer, I have been<br>
seeing the above errors. That predates the BFD to gold switch by at<br>
least a month. Though I do admit I don't remember the exact date that<br>
change landed.<br>
<br>
I have all the build logs dating back to February 22nd if that helps in<br>
anyway. Just food for thought.<br>
<br>
[1] <a href="https://www.archlinux.org/pacman/makepkg.8.html" rel="noreferrer" target="_blank">https://www.archlinux.org/pacman/makepkg.8.html</a><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Are you sure that PROT_GROWSDOWN is the flag that enables executable<br>
> stack? I thought that's what PROT_EXEC is for. I'm not sure what<br>
> PROT_GROWSDOWN actually changes, if I were to speculate, I'd say it<br>
> could be a marker that means "this is a stack" or maybe even be just a<br>
> performance hint.<br>
><br>
> Dmitri<br>
><br>
> --<br>
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>>*/<br>
> _______________________________________________<br>
> swift-dev mailing list<br>
> <a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br>
_______________________________________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>