chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

Linuxbrew installed Chapel has linkage problem #14966

Open russel opened 4 years ago

russel commented 4 years ago

I may well be the only person using Linuxbrew (Linuxbrew is Homebrew but targeting Linux rather than OSX and macOS.) to install Chapel…

$ brew install chapel

installs 1.20.0 exactly as required. I created a Mason build "Hello World" project.

$  which mason
/home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/bin/linux64-x86_64/mason

$ tree
.
├── Mason.toml
└── src
    └── HelloWorld.chpl

However:

$ mason build
Updating mason-registry
Compiling [debug] target: HelloWorld
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/main.o: relocation R_X86_64_32 against symbol `chpl_executable_init' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-linefile-support.o): relocation R_X86_64_32S against symbol `chpl_filenameTable' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-string-support.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chplcast.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(config.o): relocation R_X86_64_32S against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(error.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-comm.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-comm-diags.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-init.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-external-array.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-mem-hook.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chplmemtrack.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-privatization.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chplsys.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-tasks.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(tasks-qthreads.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(comm-none-locales.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(comm-none.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(mem-jemalloc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(qio_error.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(qio.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(qio_formatted.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(sys.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(topo-hwloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(arg.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-env.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-comm-callbacks.o): relocation R_X86_64_32S against symbol `chpl_comm_callback_counts' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-mem-desc.o): relocation R_X86_64_32S against symbol `chpl_mem_descs' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(chpl-tasks-callbacks.o): relocation R_X86_64_32S against symbol `chpl_task_callback_counts' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(qbuffer.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/lib/linux64/gnu/x86_64/arch-native/loc-flat/comm-none/tasks-qthreads/tmr-generic/unwind-none/mem-jemalloc/atomics-cstdlib/hwloc/re2/fs-none/lib_pic-none/libchpl.a(deque.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(jemalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(arena.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(base.o): relocation R_X86_64_32S against hidden symbol `chpl_je_size2index_tab' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(chunk.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(ctl.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(extent.o): relocation R_X86_64_32S against hidden symbol `chpl_je_size2index_tab' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(huge.o): relocation R_X86_64_32S against hidden symbol `chpl_je_chunks_rtree' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(mutex.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(pages.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(prof.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(quarantine.o): relocation R_X86_64_32S against hidden symbol `chpl_je_size2index_tab' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(stats.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(tcache.o): relocation R_X86_64_32S against hidden symbol `chpl_je_index2size_tab' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(tsd.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(util.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(witness.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/jemalloc/install/linux64-x86_64-native-gnu-none/lib/libjemalloc.a(ckh.o): relocation R_X86_64_32S against hidden symbol `chpl_je_size2index_tab' can not be used when making a PIE object
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(feb.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(qthread.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(mpool.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(nemesis_threadqueues.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(donecount.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(hwloc_via_chapel.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(teams.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(hash.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(cacheline.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(envariables.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(hazardptrs.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(io.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(queue.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(lt1-feb.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/qthread/install/linux64-x86_64-native-gnu-none-flat-jemalloc-hwloc/lib/libqthread.a(syncvar.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(traversal.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(distances.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(components.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(bind.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(bitmap.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(misc.o): relocation R_X86_64_32S against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-noos.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-synthetic.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-custom.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-xml.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-xml-nolibxml.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-linux.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-hardwired.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(topology-x86.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/third-party/hwloc/install/linux64-x86_64-native-gnu-none-flat/lib/libhwloc.a(base64.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make: *** [/home/linuxbrew/.linuxbrew/Cellar/chapel/1.20.0_2/libexec/runtime/etc/Makefile.exe:30: /tmp/chpl-russel-173972.deleteme/HelloWorld.tmp] Error 1
error: compiling generated source
Build Failed

So the problem here is that by default Mason and chpl are assuming dynamic linking but only the static library is being build by the Linuxbrew formula.

$ chpl --static src/HelloWorld.chpl 

$ ./HelloWorld 
Hello World.

$

I guess there is not a similar problem with Homebrew OSX and macOS. I have no idea if the Linuxbrew formula can cause both dynamic and static libraries to be build, but if it cannot Linuxbrew is a total bust for Chapel.

mppf commented 4 years ago

@russel - in order to allow us to reproduce this, can you tell us the linux OS version you are using (Ubuntu, Debian, ... ?) and also give us a couple of hints about how to install Linuxbrew to the point we can do brew install chapel on that OS? Thanks.

russel commented 4 years ago

@mppf I think the Linuxbrew home page is now as follows – Linuxbrew was a fork but has now been integrated into Homebrew, so Linuxbrew is not a separate thing:

https://docs.brew.sh/Homebrew-on-Linux

I am using Debian Sid. I believe Linuxbrew should work on Debian, Ubuntu, and Mint in identical fashion – but this is very much a belief statement.

mppf commented 4 years ago

So far I've been able to reproduce on a Debian VM. On that system, the master branch and 1.20 compile a "hello world" just fine under quickstart and standard configurations.

I used the homebrew-on-linux instructions but maybe sudo apt install linuxbrew-wrapper would work on Ubuntu.

brew install chapel --build-from-source worked for me.

I don't know what is wrong but... at a guess, maybe the automation used by Linuxbrew is using a compiler with different defaults (maybe it has some sort of hardening enabled) that is affecting the pre-built version stored in the "bottle"?

russel commented 4 years ago

@mppf I did:

brew reinstall chapel --build-from-source

and then:

mason build

works out of the box. The problem thus comes down to the Homebrew formula not building both the static and dynamic files for the central bottling, at least for the Linux bottle – does it for the macOS bottle?

mppf commented 4 years ago

The homebrew formula just runs make and doing so in the default configuration doesn't build both the static and dynamic files either. Normally this is fine (it just uses whatever the default is) but the issue appears to be the default is different between the linuxbrew build system and the systems we are trying it on.

russel commented 4 years ago

@mppf Does that imply the Chapel make script is not doing the right default for the platform?

mppf commented 4 years ago

@russel - when the linuxbrew systems create binary "bottles" there are two platforms involved aren't there? One is the platform on which make runs (presumably in linuxbrew cloud land somewhere), and the other is the end user system? Do you have some reason to believe that these two platforms are the same? (E.g. same OS version, same compiler, same glibc, ...) ? Obviously they need to be similar for the system to work, but they are apparently different (based on this issue, anyway).

Anyway it might be possible for the Chapel build scripts to detect the default static/dynamic preference for the currently used compiler, to adjust the build path to match. If we did that, something like the homebrew build could build both the shared and static libraries.

Another option is that we could adjust the homebrew script to always set CHPL_LIB_PIC=pic. That would make the situation match the situation on Mac OS X, where binaries are always PIC. However this might come at a performance cost.

(For history... CHPL_LIB_PIC behavior is related to PRs #11327 and #945).

@lydia-duncan @ronawho - any thoughts here?

lydia-duncan commented 4 years ago

Is there any reason to suspect that linuxbrew clients want the default PIC behavior that brew on Macs would provide? Or is linuxbrew really more about downloading and installing packages in a true-to-the-linux-platform fashion?

If it's really "I want the same experience as a Mac", then I think setting CHPL_LIB_PIC=pic is appropriate. If it's "I want the same experience for installing as a Mac, but I really care that I'm doing this on a linux machine", then I'm more inclined to build both the shared and static libraries

russel commented 4 years ago

@lydia-duncan @mppf @ronawho I'd say that Linux users of Homebrew are looking for the native Linux experience. This would seem to support ensuring both dynamic and static libraries are build, especially the dynamic ones. Crucially though the built Mason executable in the default build (assume dynamic linkage) is not currently compatible with the default library build (static only). Changing the Homebrew build for Linux to build both static and dynamic libraries seems to be the right solutions? I'd suggest that assuming Linux users want the macOS is definitely not a good move.

bradcray commented 4 years ago

@mppf / @lydia-duncan: I've lost the thread here. Is the expected fix for this something that needs to take place in the Chapel source tree (in which case it'd be nice to make it for the next release), or is it something that just needs to be updated in the linuxbrew formula? Or do we not know? Thanks!

mppf commented 4 years ago

@bradcray - I think this is probably the next step:

Anyway it might be possible for the Chapel build scripts to detect the default static/dynamic preference for the currently used compiler, to adjust the build path to match. If we did that, something like the homebrew build could build both the shared and static libraries.

There is also a temporary workaround available to us - we could adjust the linuxbrew package to set CHPL_LIB_PIC=pic both in making the compiler and setting up to use it. We could consider doing that for this release and doing the more involved step later.

bradcray commented 4 years ago

@mppf: For the temporary workaround, that's something we could do anytime, independently of the release cycle, right? (i.e., its a change to the LinuxBrew code base, not ours?).

mppf commented 4 years ago

@bradcray - yes

mppf commented 4 years ago

I was wondering how easy it would be to find out if the compiler was configured for position independent code and I found this:

https://unix.stackexchange.com/questions/89211/how-to-test-whether-a-linux-binary-was-compiled-as-position-independent-code

It looks like we could compile something and test it with file but only with a sufficiently new enough version of file.

russel commented 4 years ago

file 5.38 seems to require Debian Testing or Ubuntu 20.04 LTS