clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
17 stars 5 forks source link

3.8 update: no link script build fails #88

Closed nenadv closed 8 years ago

nenadv commented 8 years ago

A build on Mac OS X failed as it does not use linker script (compile error in MCObjectFileInfo.cpp). I made this change to make it work:

diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp
index 85dc0f5..a7dd4ce 100644
--- a/lib/MC/MCObjectFileInfo.cpp
+++ b/lib/MC/MCObjectFileInfo.cpp
@@ -478,12 +478,10 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) {
 #ifndef LIBUPC_LINK_SCRIPT
   UPCSection =
     Ctx->getELFSection("upc_shared", ELF::SHT_NOBITS,
-                       ELF::SHF_WRITE |ELF::SHF_ALLOC,
-                       SectionKind::getReadOnly());
+                       ELF::SHF_WRITE |ELF::SHF_ALLOC);
   UPCPgmSection =
     Ctx->getELFSection("upc_pgm_info", ELF::SHT_PROGBITS,
-                       ELF::SHF_ALLOC,
-                       SectionKind::getDataRel());
+                       ELF::SHF_ALLOC);
 #endif
nenadv commented 8 years ago

Fixed by this update to llvm-upc - https://github.com/Intrepid/llvm-upc/commit/87fc9a4f62dc1388ff6fc62f86dc1d077ac749af