> 
> On Tue 24 Dec 2019 at 10:23, Aaron Sloman <[email protected]>
> wrote:
> 
> > I've managed to produce a script available here
> >
> >     https://www.cs.bham.ac.uk/research/projects/poplog/V16/getpoplog.sh
> >
> > viewable in a browser as:
> >
> >     https://www.cs.bham.ac.uk/research/projects/poplog/V16/getpoplog
> >
> > On my fedora machine at home, with a fairly fast internet
> > connection, if I
> > run the script it fetches all the required files and builds a
> > usable
> > poplog
> > with the documentation files and packages from Birmingham
> > included
> > -- in
> > less than a minute. I was amazed at the speed.
> 
> Hello and thanks for the script.
> 
> Unfortunately, when I run it I get a few warnings about type
> declarations. But what is more important are the following errors:
> /usr/bin/ld: poplink_3.o: relocation R_X86_64_32S against `.text'
> can
> not be used when making a PIE object; recompile with -fPIE
> amd there are lots like that.
> In the end poplog doesn't build.
> 
> Does anyone know what to correct in the build process?

I have no time to check what exactly is done by Aaron's 
script.  But one issue is very likely.  Namely Poplog can
not work as a position independent executable (PIE).
Some new Linux distribution by default make PIE executable.
On such system we need '-nopie' option when linking using gcc.
Unfortunatly, on other (older) system this option is not
known by gcc and causes link failure.  In particular on
system that I use '-nopie' causes failure -- so it is
absent is sources that I provide.  I posted a small patch
that changes sorces so that it is used.  Ideally before
build we would run configure style script to figure out
if '-nopie' should be used or not.

Anyway, on your system 'pop/pop/poplink_cmnd' should
have in line 5:

$POP__cc -v -no-pie -Wl,-export-dynamic
            ^^^^^^^
If that is missing you need to apply the 'nopie.diff' patch.
'nopie.diff' is included in 'poplog_base...' tarball that
I provide.  Just in case I also attach it to this message.

OTOH if you have this line in 'pop/pop/poplink_cmnd', then
we have deeper problem.  I such case we should ask how
to create normal (no PIE) executable on Arch.

-- 
                              Waldek Hebisch
diff -ru trunk/pop/src/syscomp/x86_64/asmout.p 
/home/s/prow/p-wyk4/pp6/pop/src/syscomp/x86_64/asmout.p
--- trunk/pop/src/syscomp/x86_64/asmout.p       2019-03-10 17:40:19.855051382 
+0100
+++ trunk/pop/src/syscomp/x86_64/asmout.p       2019-06-26 13:02:17.469420016 
+0200
@@ -382,7 +381,7 @@
 
     ;;; Use C compiler to link
 constant
-    cc_link_command_header = '$POP__cc -v -Wl,-export-dynamic 
-Wl,-no-as-needed -o $IM \\\n'
+    cc_link_command_header = '$POP__cc -v -no-pie -Wl,-export-dynamic 
-Wl,-no-as-needed -o $IM \\\n'
 ;
 
 #_ELSE

Reply via email to