-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Support GCC 7 #1756
Comments
Is this on a standard intel cpu? Can you run the make command using
instead of
and paste the output here? Its going to be a lot more output. At the moment, I'm most interested in verifying that the |
also, can you run
in the terminal and report the result here? i'm expecting to see 64. |
Just the end of the output, confirming the hypothesis.:
|
Output as requested:
|
Thanks @russel. Well, that is all very confusing. If you have a gcc 6/debian machine available could you build pony on that with
|
Also can you try:
on Fedora and see if linking is successful. |
The Fedora experiment on a compiled up repository:
install the libatomic package and:
|
So, what I'm thinking you might have to install libatomic on Fedora. https://www.rpmfind.net/linux/rpm2html/search.php?query=libatomic But really, I'm mostly guessing here. The g++ atomics support should have those functions. The only errors I can see people hitting are on non-intel platforms and then the So my guess would be is that Fedora is doing something interesting with atomics support with gcc and packaging it differently than other platforms and that you have to explicitly install libatomic and you need to explicitly link against it, but, I could be very wrong on that. At the moment, it seems to be the most reasonable explanation. |
Do you want me to ask the RedHat GCC folk to take a peek? |
I can't do the Debian test just yet I'm afraid, long story. I will as soon as I can. |
@russel if you are in a position to ask them where you think they might respond, by all means. I don't have access to a fedora system so I'm flying blind here. If you don't have a libatomic installed, I'd first try installing it and trying the last |
I have sent email to a person I know will either know the answer or know the person to ask to get a definitive answer. |
I don't know what Debian does, but Fedora's GCC is fairly close to the upstream GCC config. There is a separate package for libatomic though.
|
Note that the |
OK, I have now rebooted to Debian Sid. I have libatomic1 installed automatically because I have TBB and libgcc-6-dev installed, both of which require the atomics. I am guessing Fedora doesn't have an equivalent for this so libatomics must be installed manually. Interestingly I have TBB installed on Fedora, but atomics didn't get installed as a dependency. Oh well. For the same data as provided earlier for Fedora but now for Debian:
so no -latomics, and no error. |
@russel is libatomic installed on Fedora? |
@jwakely thank you for the info! |
I have now manually install libatomic on Fedora, but this is now a different computer, a laptop rather than a workstation. This is though a good test since it is a different processor and memory architecture. Just running "make verbose=1" on the Fedora Rawhide laptop results in the same behaviour as before even with libatomic installed:
so whilst an explicit -latomic is needed on Fedora it is not on Debian. I wonder if using CMake, SCons or Meson, would get rid of the problem as the use of pkg-config should get all the dependencies right. Of course this can be done in Make, but it is a lot harder. The real concern though, given the separateness of the atomics library, how did this ever work on Debian? |
So to verify, @russel. If Correct? |
It definitely seems that way. If you make the change to the build, I can check on Debian and Fedora to make sure no change on Debian and success on Fedora. |
GCC will try to lower the C atomic operations to hardware instructions instead of library calls when it can. Maybe GCC is configured differently on Debian and Fedora, with only one being able to detect that the hardware supports the relevant atomic operations. |
@sylvanc thinks this is a GCC 7.0 issue. we need to do a travis run with gcc 7.0 and see what goes boom. |
We can't get gcc 7 on travis. At this time, we don't support gcc 7 yet. |
I finally got this working on Archlinux with GCC 7.1.1
diff --git a/Makefile b/Makefile
index a795d8f57..dd8923b97 100644
--- a/Makefile
+++ b/Makefile
@@ -437,11 +437,11 @@ libponyc.benchmarks.links = libgbenchmark libponyc libponyrt llvm
libponyrt.benchmarks.links = libgbenchmark libponyrt
ifeq ($(OSTYPE),linux)
- ponyc.links += libpthread libdl
- libponyc.tests.links += libpthread libdl
- libponyrt.tests.links += libpthread libdl
- libponyc.benchmarks.links += libpthread libdl
- libponyrt.benchmarks.links += libpthread libdl
+ ponyc.links += libpthread libdl libatomic
+ libponyc.tests.links += libpthread libdl libatomic
+ libponyrt.tests.links += libpthread libdl libatomic
+ libponyc.benchmarks.links += libpthread libdl libatomic
+ libponyrt.benchmarks.links += libpthread libdl libatomic
endif I could install both gcc6 an gcc7 on a debian sid docker container and got the same error with EDIT: this ponyc itself cannot link pony programs, now as libatomic is also needed (I'm sure it's NOT the correct way but it works for me): diff --git a/src/libponyc/codegen/genexe.c b/src/libponyc/codegen/genexe.c
index 304a6f675..a063818d8 100644
--- a/src/libponyc/codegen/genexe.c
+++ b/src/libponyc/codegen/genexe.c
@@ -277,7 +277,7 @@ static bool link_exe(compile_t* c, ast_t* program,
#ifdef PONY_USE_LTO
"-flto -fuse-linker-plugin "
#endif
- "%s %s %s %s -lpthread %s -lm %s",
+ "%s %s %s %s -lpthread -latomic %s -lm %s",
linker, file_exe, arch, mcx16_arg, fuseld, file_o, lib_args, ponyrt, ldl,
export
); |
@lisael That would be the correct way for the code changes. Would you be up for doing a PR with those changes? I think the only question remaining is whether we need to setup a test environment with GCC 7. @ponylang/committer Thoughts? |
Test environment for GCC 7 seems like a good idea |
I'd like to suggest raising the priority on this one, if I may. Whilst this used to be a Rawhide only problem, it is now a Debian Sid problem: Debian Sid has just moved from GCC 6 to GCC 7 as the default compiler suite, so the bug originally reported as not being a problem on Debian Sid is now a problem, on Debian Sid:
|
I looked into this. It's a gcc bug. Woo hoo! I'm going to PR this and hope it doesn't break anything else. |
Our only GCC7 issue appears to that it needs to be linked against libatomic explicitly. This commit links to libamotic explicitly on any Linux platform regardless of compiler version. Closes #1756
PR opened: #2134 |
Our only GCC7 issue appears to that it needs to be linked against libatomic explicitly. This commit links to libamotic explicitly on any Linux platform regardless of compiler version. Closes #1756
Our only GCC7 issue appears to that it needs to be linked against libatomic explicitly. This commit links to libamotic explicitly on any Linux platform regardless of compiler version. Closes #1756
Our only GCC7 issue appears to that it needs to be linked against libatomic explicitly. This commit links to libamotic explicitly on any Linux platform regardless of compiler version. Closes #1756
I pulled the Git repository to 499a1df on Debian Sid. I then did my usual:
and the resulting ~/Built/bin/ponyc seems to behave admirably.
|
Thanks @russel ! |
No problem. I am just worrying about the:
in the updated instructions on the front page, I haven't set the Make option default_pic. |
@russel you dont have set it. it just means you no longer have to do
|
a99a1dfff compiles correctly for me too on archlinux. Thanks! (sorry I was on vacation and did not check my github notifications for a month or so) |
@SeanTAllen Aha being able to lose the --pic option is good. :-) |
@russel ya, it's "small" but we think it will be a big usability win. it was a great idea on @dipinhora's part. |
Building Pony on Debian Sid works fine. When I try to build Pony on
Fedora Rawhide, I get:
everything before this is fine. I am guessing this is a GCC version
thing. Debian Sid has GCC 6.3 where Fedora Rawhide has GCC 7.0.
Update 2017-08-05: This is now a problem on Debian Sid as it has just switched to GCC 7 as the default compiler suite.
The text was updated successfully, but these errors were encountered: