Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#55170 - [ponyc] Cannot compile simple "Hello World!"

Attached to Project: Community Packages
Opened by Dario Ostuni (dariost) - Wednesday, 16 August 2017, 18:06 GMT
Last edited by Felix Yan (felixonmars) - Thursday, 21 December 2017, 09:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No


When trying to compile this simple program:
$ cat main.pony
actor Main
new create(env: Env) =>
env.out.print("Hello World!")
it gives the following error:
$ ponyc
Building builtin -> /usr/lib/pony/0.17.0/packages/builtin
Building . -> /tmp/hw
Selector painting
Data prototypes
Data types
Function prototypes
Writing ./hw.o
Linking ./hw
Warning: environment variable $CC undefined, using cc as the linker
/usr/bin/ errore: ./hw.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ errore: ./hw.o: requires dynamic R_X86_64_32 reloc against 'pony_personality_v0' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
unable to link: cc -o ./hw -O3 -march=x86-64 -mcx16 -latomic -fuse-ld=gold ./hw.o -L"/usr/lib/pony/0.17.0/bin/" -Wl,-rpath,"/usr/lib/pony/0.17.0/bin/" -L"/usr/lib/pony/0.17.0/bin/../packages" -Wl,-rpath,"/usr/lib/pony/0.17.0/bin/../packages" -L"/usr/local/lib" -Wl,-rpath,"/usr/local/lib" -Wl,--start-group -Wl,--end-group -lpthread -lponyrt -ldl -lm -Wl,--export-dynamic-symbol=__PonyDescTablePtr -Wl,--export-dynamic-symbol=__PonyDescTableSiz

Additional info:
ponyc version 0.17.0-1

This might be relevant:
This task depends upon

Closed by  Felix Yan (felixonmars)
Thursday, 21 December 2017, 09:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  0.21.0-2
Comment by Simon Génier (ilovemonoids) - Wednesday, 23 August 2017, 02:13 GMT
I found 2 issues with the package.

* It need to generating position independent code.
* It needs to explicitly link to openssl 1.0.

I attached a patch that fixed both issues (on my machine).
Comment by Dario Ostuni (dariost) - Saturday, 23 September 2017, 12:48 GMT
Until now my workaround was compiling with `CC=clang ponyc`, since clang 5.0 this doesn't work anymore, and the package still hasn't been fixed.