On Mon, Jun 13, 2016, at 11:33 PM, Dmitri Gribenko via swift-dev wrote: > On Sat, Jun 11, 2016 at 8:12 AM, 김종수 via swift-dev <swift-dev@swift.org> > wrote: > > I am testing Swift in "Windows Subsystem for Linux" which is a new feature > > of Windows 10 Anniversary Update scheduled in this year. WSL is Ubuntu LTS > > 14.04 compatible in user space. > > > > Swift runtime libraries such as libswiftCore.so are marked Executable Stack, > > which have no problem in Linux. > > > > dlopen()'ing swift runtime libraries causes mprotect() with PROT_GROWSDOWN, > > which is not documented but verified with strace. > > > > WSL has not implemented PROT_GROWSDOWN feature because of clean room > > development. > > > > Swift runtime libraries had not been marked Executable Stack before Febrary > > snapshot. And cmark and llvm/clang shared libraries are not marked too. > > > > ***My request is swift runtime libraries be not marked Executable Stack.*** > > Hi, > > This could have been caused by our switch from the BFD linker to gold. > Could you try linking a hello world program using gold linker and > running it in WSL?
I _think_ this problem existed before the switch from BFD to gold. I build and package a version of Swift for Linux. During the package processes makepkg [1] checks the installed binaries for common gotchas (I tried looking up exactly what is run but could not find it quickly). My point is that I've been seeing: swiftc W: ELF file ('usr/bin/swift-test') has executable stack. swiftc W: ELF file ('usr/bin/repl_swift') has executable stack. swiftc W: ELF file ('usr/bin/swift-build') has executable stack. swiftc W: ELF file ('usr/lib/swift/pm/libPackageDescription.so') has executable stack. swiftc W: ELF file ('usr/lib/swift/linux/libswiftGlibc.so') has executable stack. swiftc W: ELF file ('usr/lib/swift/linux/libXCTest.so') has executable stack. swiftc W: ELF file ('usr/lib/swift/linux/libswiftCore.so') has executable stack. swiftc W: ELF file ('usr/lib/swift/linux/libFoundation.so') has executable stack. Since at least the 20160208a release, but probably longer, I have been seeing the above errors. That predates the BFD to gold switch by at least a month. Though I do admit I don't remember the exact date that change landed. I have all the build logs dating back to February 22nd if that helps in anyway. Just food for thought. [1] https://www.archlinux.org/pacman/makepkg.8.html > > Are you sure that PROT_GROWSDOWN is the flag that enables executable > stack? I thought that's what PROT_EXEC is for. I'm not sure what > PROT_GROWSDOWN actually changes, if I were to speculate, I'd say it > could be a marker that means "this is a stack" or maybe even be just a > performance hint. > > 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 <griboz...@gmail.com>*/ > _______________________________________________ > swift-dev mailing list > swift-dev@swift.org > https://lists.swift.org/mailman/listinfo/swift-dev _______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev