Solution to #1484 has been decided that we will check for gcc for running on linux and use --pic in those cases by default. We believe this should make for a better experience for users. It might cause some issues but we can address them if they arises.
We decided against this.
Hi Sean, could you explain that decision? I just installed Pony on Ubuntu 16.10 and ran into the exact same problem. I'm thinking about others who like me ran into the same issue but might have just given up -- and leaving with a bad first impression of Pony (ie: it doesn't even compile "helloworld").
Hi @sebastien, I can.
Some Linux distros require --pic, others don't. Building with --pic everywhere would hurt performance on platforms where it isn't required. As such we decided that doing for gcc in general was a bad idea. There are probably better ways to address than the rather blunt instrument of turning on for gcc.
OK, so what about testing for $DISTRIB_ID="Ubuntu" and set the --pic flag accordingly in the build system?
If that consistently works and doesn't cause issues, then yes, that seems
like a reasonable PR.
On Tue, Jun 27, 2017 at 4:29 PM, Sébastien Pierre notifications@github.com
wrote:
OK, so what about testing for $DISTRIB_ID="Ubuntu" and set the --pic flag
accordingly in the build system?—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/ponylang/ponyc/issues/1811#issuecomment-311475931,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAL0PIpS-xKQxrgr_bEnHDgiKGsCNpbsks5sIWZGgaJpZM4M0ufs
.
@sebastien Sorry, I'm a bit lost - where does this DISTRIB_ID come from?
@jemc it is defined in /etc/lsb_release. I am not sure where to add the code, but if it were to be in pony's Makefile, it would look like this:
ifeq ($(shell test -f /etc/lsb-release && grep DISTRIB_ID /etc/lsb-release | cut -d= -f2),Ubuntu)
BUILD_FLAGS += --pic
LINKER_FLAGS += --pic
endif
Am happy to create a pull request if you can point me to which file sets up the build environment variables for the ponyc command.
Curious - is the PIC performance impact measurable? In particular, I wonder if it would make sense to just enabled PIC on x86_64 hardware, where afaik there is no meaningful performance impact.
There's definitely a performance impact. It adds a level of indirection that wouldn't otherwise exist. The higher the load on your system, the more you will feel the impact of that impact.