Compile fpc 64 bit from /fixes_3_2/

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Compile fpc 64 bit from /fixes_3_2/

fredvs
Hello.

I have a strange result while compiling fpc from
https://svn.freepascal.org/svn/fpc/branches/fixes_3_2/.

Here, on Linux Debian 10.1 multi-arch (64 bit + 32 bit), when I do
compilation with that script:
------------------
#!/bin/sh

cd fixes_3_2

TARGET_VER=3.2.0
TARGET=x86_64-linux
COMPILER=/usr/lib/fpc/3.0.4/ppcx64

make clean
make all FPC=$COMPILER OPT="-Fl/usr/local/lib"
make install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER
------------------------

The script first clean everything and do the compilation of fpc with ppcx64
and all seems ok.
But, when the compilation is ok and a "new" ppcx64 is created, I dont know
why, the process continue, remove all was already done, recompile all using
ppc386 (fpc 32 bit) and finally only install new fpc 32 bit (ppc386).

The good news is that new installation of fpc.3.2. and ppc386 is working
perfectly.

How to do to have the fpc 64 bit (ppcx64), why is it deleted using the above
script?

I did try using this: make all FPC=$COMPILER CPU_TARGET=x86_64
OPT="-Fl/usr/local/lib"
But, the same, the result is a fpc 32 bit (no 64 bit).

What is wrong?

Thanks.

Fre;D








-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Many thanks ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Compile fpc 64 bit from /fixes_3_2/

Pierre Muller


Le 08/10/2019 à 17:02, fredvs a écrit :

> Hello.
>
> I have a strange result while compiling fpc from
> https://svn.freepascal.org/svn/fpc/branches/fixes_3_2/.
>
> Here, on Linux Debian 10.1 multi-arch (64 bit + 32 bit), when I do
> compilation with that script:
> ------------------
> #!/bin/sh
>
> cd fixes_3_2
>
> TARGET_VER=3.2.0
> TARGET=x86_64-linux
> COMPILER=/usr/lib/fpc/3.0.4/ppcx64
>
> make clean
> make all FPC=$COMPILER OPT="-Fl/usr/local/lib"
> make install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER
> ------------------------
>
> The script first clean everything and do the compilation of fpc with ppcx64
> and all seems ok.
> But, when the compilation is ok and a "new" ppcx64 is created, I dont know
> why, the process continue, remove all was already done, recompile all using
> ppc386 (fpc 32 bit) and finally only install new fpc 32 bit (ppc386).
>
> The good news is that new installation of fpc.3.2. and ppc386 is working
> perfectly.
>
> How to do to have the fpc 64 bit (ppcx64), why is it deleted using the above
> script?
>
> I did try using this: make all FPC=$COMPILER CPU_TARGET=x86_64
> OPT="-Fl/usr/local/lib"
> But, the same, the result is a fpc 32 bit (no 64 bit).
>
> What is wrong?

  In your last line:
 make install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER

you do not specify any FPC make variable value.

In such cases, the Makefile will look for fpc
binary in the path, probably find it as /usr/bin/fpc
and it will depend on which /usr/bin/fpc it is:

  If this binary is linked to the i386-linux installation,
it will give i386 as default CPU_TARGET and linux as OS_TARGET,
and you will thus use ppc386 executable to recompile everything.

  I suppose this all comes from the fact that the x86_64 Free pascal
was installed before the i386 version, thus overwriting the x86_64 version of fpc binary.

  You can fix your problem simply by adding explicitly
 FPC=$COMPILER
to the make install line.

Pierre
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compile fpc 64 bit from /fixes_3_2/

fredvs
Hello Pierre and thanks for answer.

> You can fix your problem simply by adding explicitly
> FPC=$COMPILER
> to the make install line.

Huh, in the script that I use:

> ------------------
> #!/bin/sh
>
> cd fixes_3_2
>
> TARGET_VER=3.2.0
> TARGET=x86_64-linux
> COMPILER=/usr/lib/fpc/3.0.4/ppcx64
>
> make clean
> make all FPC=$COMPILER OPT="-Fl/usr/local/lib"
> make install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER
> ------------------------

Do you mean that in the script? :

> COMPILER=/usr/lib/fpc/3.0.4/ppcx64
> ...
> make all FPC=$COMPILER OPT="-Fl/usr/local/lib"

Will not work, I have to use this one:

---> make all FPC=/usr/lib/fpc/3.0.4/ppcx64 OPT="-Fl/usr/local/lib

OK, I will try it.
But I still dont understand why there is a loop at compilation, this are the
steps:

1) clean all,
2) then compile using ppcx64,
3) clean all,  ----> why this loop ?
4) then compile using ppc386 ----> why this loop ?
5) install the complied data.

>  I suppose this all comes from the fact that the x86_64 Free pascal
> was installed before the i386 version, thus overwriting the x86_64 version
> of fpc binary.

Ha, ok, indeed i386 version was installed as last one.
If above script does not work, I will try this, reinstall  x86_64 Free
pascal over i386.

Many thanks.

Write you later.

Fre;D










-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Many thanks ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Compile fpc 64 bit from /fixes_3_2/

Marco van de Voort-2
In reply to this post by fredvs

Op 2019-10-08 om 17:02 schreef fredvs:
>
> The script first clean everything and do the compilation of fpc with ppcx64
> and all seems ok.
> But, when the compilation is ok and a "new" ppcx64 is created, I dont know
> why, the process continue, remove all was already done, recompile all using
> ppc386 (fpc 32 bit) and finally only install new fpc 32 bit (ppc386).

Here is my buildscript used to build a new snapshot. Note that it passes
the /new/ compiler to make install.  (FPC=compiler/$GENCOMPILER)

The script is made so that I can easily move it around machines and only
adapt things like "CORES", OPTSETTINGS etc.

#!/usr/bin/env bash
# simple i386/x86_64 building on linux/*BSD.

# Rule of thumb physical+1
CORES=5
HOSTARCH=`uname -m`
HOSTOS=`uname -s`
SRCDIR=/fpc/fpctrunk
DESTDIR=~/src/builded
HAVEDEBUG=1
OVERRIDEDETECTION=0
HAVEOPT=0
LIBCRTL=0
ARGS=" -viwn -Sg -Fl/usr/local/lib  -dLZX_USETHREADS "
OPTSETTINGS=" -O4 -Opcoreavx -Cpcoreavx  -Cfavx "
DEBUGSETTING=" -gw2 -godwarfsets "

#----------------------

is64=0
START=ppcrel
GENCOMPILER=ppc386
NEWOPT=""

if [ $LIBCRTL = "1" ] ; then
   ARGS+=" - dFPC_USE_LIBC "
fi
if [ $OVERRIDEDETECTION != 1 ]; then
if [ "$HOSTARCH" = "x86_64" ] ; then
   is64=1
fi
if [ "$HOSTARCH" = "amd64" ] ; then
   is64=1
fi
fi

if [ $is64 = 1 ]; then
   START=ppcrel64
   GENCOMPILER=ppcx64
fi

if [ "$HAVEDEBUG" = "1" ] ; then
   if [ "$ARGS" != "" ]; then
    ARGS="$ARGS$DEBUGSETTING"
   fi
fi

if [ "$HAVEOPT" = "1" ] ; then
   $NEWOPT=$OPTSETTINGS
fi

GMAKE=gmake
if [ $HOSTOS = "Linux" ] ; then
   GMAKE=make
fi

JOPT="-j $CORES"
FPMAKEOPT="-T $CORES"
while getopts ":nj:" optname
   do
     case "$optname" in
       "j")
         echo Cores overriden to $OPTARG
         JOPT="-j $OPTARG"
         FPMAKEOPT="-T $OPTARG"
         ;;
       "n")
          JOPT=""
         ;;
       *)
         echo "Unknown error while processing options"
         ;;
     esac
   done

if [ $OVERRIDEDETECTION != 1 ]; then
echo ARCH is $HOSTARCH on \(OS:\) $HOSTOS
echo Build in $SRCDIR, installing in $DESTDIR with $CORES cores
fi

cd $SRCDIR

$GMAKE $JOPT clean all  FPMAKEOPT="$FPMAKEOPT" PP="$START" FPC="$START"
OPT="$ARGS" NEWOPT="$NEWOPT" &> ~/buildlog64

if [ ! $? = 0 ] ; then
  echo Grr, failed again
else
  $GMAKE install FPC=compiler/$GENCOMPILER OPT="$ARGS" NEWOPT=$NEWOPT
INSTALL_PREFIX=$DESTDIR &> ~/installog64
  if [ ! $? = 0 ] ; then
   echo INSTALL failed | tee ~/outcome
  else
   echo Everything _should_ be fine.| tee ~/outcome
  fi
fi



_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compile fpc 64 bit from /fixes_3_2/

fredvs
In reply to this post by Pierre Muller
Hello.

> Write you later.

+

> You can fix your problem simply by adding explicitly
> FPC=$COMPILER
> to the make install line.

Ooops, ok, I think I get it (maybe):
I have to add the compiler used for "make install" too, like this:

make FPC=$COMPILER install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER

OK, I will try this.

Re-write you later.

Fre;D



-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Many thanks ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Compile fpc 64 bit from /fixes_3_2/

fredvs
Hello Pierre, Marcov and everybody.

OK, the tip works!

So, to everybody, if you have a multi-arch system, always define the
compiler used in your make command-line.
Even for a "make install":

So a working script would be for 64/32 bit:
__________________

#!/bin/sh

cd fixes_3_2

TARGET_VER=3.2.0

TARGET=x86_64-linux
               #(or i386-linux)

COMPILER=/usr/lib/fpc/3.0.4/ppcx64
                  #( or ppc386)    

make clean
make all FPC=$COMPILER OPT="-Fl/usr/local/lib"
make FPC=$COMPILER install INSTALL_PREFIX=/usr/lib/fpc/$TARGET_VER
___________________

Many tanks Pierre.

Huh, I forgot the boring question:

When this:

> Free Pascal Compiler version 3.2.0-beta [2019/10/08] for x86_64:
> Copyright (c) 1993-2018 by Florian Klaempfl and others

will become that?:

> Free Pascal Compiler version 3.2.0 [2019/10/08] for x86_64:
> Copyright (c) 1993-2019 by Florian Klaempfl and others

;-)

Fre;D







-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Many thanks ;-)