It is currently Sat Feb 23, 2019 5:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: shared object and how to fix?
PostPosted: Wed Jul 26, 2017 6:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 185
As from this topic viewtopic.php?f=23&t=66990 this is not a bug. If some one can please help to configure or make this work it would be great thanks.

I am using Arch linux which recently decided to enable PIE and SSP in gcc. What ever changes they made has also affected PureBasic so now that when I build anyting it will be flaged as "shared object" and not "executable".

I have found this example how to fix it in gcc so if some one knows how I can apply or do something similar in PureBasic it would fix this issue I think.

Code:
You should add -no-pie option to compilation command line

without :

$ gcc main.c -o main

$ file main

main:ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=46ada4e5e25fc120ca052c9beb8bfa5491fc6239, not stripped

wtih :

$ gcc main.c -o main -no-pie

$ file main

main: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=17f860c6c84fc1a5771c8744b7aaaf164c219559, not stripped


Thanks

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: shared object and how to fix?
PostPosted: Sat Jul 29, 2017 3:32 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 185
Some times the answers are staring you right in the face.. then they just slap you because you didnt see it earlier :)

Anyways if any one else is having this issue this seemed to fix it for me by just adding this to the top of the code.

Code:
ImportC "-no-pie" : EndImport


Hope it helps some one else and I am happy to be able to make "executable" files again and not "shared object" files :)

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: shared object and how to fix?
PostPosted: Sat Jul 29, 2017 7:05 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 294
Location: Germany
Thank you so much! I had the same problem.

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download -- Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye