Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing compiler - incompatible with GCC-7.x #863

Closed
Thizizmyname opened this issue Apr 6, 2018 · 0 comments
Closed

Installing compiler - incompatible with GCC-7.x #863

Thizizmyname opened this issue Apr 6, 2018 · 0 comments

Comments

@Thizizmyname
Copy link

Current Behavior

When installing the compiler from development on debian based systems, no apparent faults are noticed in output.
However, when compiling any encore file the code generation breaks giving the subsequent error:

alexis@alexis-zen:~/encoretest$ encorec plusplus.enc -c
/home/alexis/github/encore/release/lib/libponyrt.a(pool.o): In function `pool_pull':
/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:763: undefined reference to `__atomic_compare_exchange_16'
/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:763: undefined reference to `__atomic_compare_exchange_16'
/home/alexis/github/encore/release/lib/libponyrt.a(pool.o): In function `pool_push':
/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:726: undefined reference to `__atomic_compare_exchange_16'
/home/alexis/github/encore/release/lib/libponyrt.a(pool.o): In function `pool_pull':
/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:763: undefined reference to `__atomic_compare_exchange_16'
/home/alexis/github/encore/release/lib/libponyrt.a(pool.o): In function `pool_push':
/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:726: undefined reference to `__atomic_compare_exchange_16'
/home/alexis/github/encore/release/lib/libponyrt.a(pool.o):/home/alexis/github/encore/src/runtime/pony/libponyrt/mem/pool.c:726: more undefined references to `__atomic_compare_exchange_16' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 *** Compilation failed with exit code 1 ***

Temporary Workaround

This is a hack and should not be the correct solution

  1. uninstall gcc
  2. install gcc-6
  3. make a symlink of /usr/bin/gcc to /usr/bin/gcc-6
  4. cd PATH-TO-ENCORE && make -B

I did these steps after running debian-install.sh first,to ensure all other instructions had gone through before By uninstalling gcc you also delete local versions of cabal-install, ghc and other possible programs.

Possible Solution

When compiling ponyrt, make sure to link with libatomic and possibly when compiling encore-files, make sure to include -latomic

This issue have been managed in the pony-compiler with following PR ponylang/ponyc#2134
although this is for ponyc, not ponyrt

albertnetymk added a commit to albertnetymk/encore that referenced this issue Apr 6, 2018
Currently, we use gcc for building the runtime, and clang for building
the final executable when `encorec` is invoked. However, using two
compilers is not only unnecessary but error-prone as well. 465 is another bug
related to using gcc, so let's use clang in the whole build stack from
now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant