64-bit erlang

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

64-bit erlang

Kostis Sagonas-3
Scott Lystig Fritchie wrote:

 > To build a 64-bit VM on Solaris using GCC, using 'CFLAGS="gcc -m64"
 > ./configure' wasn't sufficient.  I resorted to:
 >
 >   % mkdir /tmp/gcc-hack
 >   % cat > /tmp/gcc-hack/gcc <<EOM
 >   #!/bin/sh
 >  
 >   exec /path/to/gcc -m64 $*
 >   % chmod +x /tmp/gcc-hack/gcc
 >   % set path = (/tmp/gcc-hack $path)
 >   % ./configure ....
 >   % make
 >
 > Ugly brute force, but it worked.

Issuing the simple command:

        alias gcc='gcc -m64'

would have achieved the same effect.

Kostis



Reply | Threaded
Open this post in threaded view
|

64-bit erlang

Fredrik Thulin-3
On Saturday 12 November 2005 12.01, Kostis Sagonas wrote:
...
> Issuing the simple command:
>
> alias gcc='gcc -m64'
>
> would have achieved the same effect.

No it wouldn't, since the 'gcc' command is executed by 'make' and not by
your shell (which has the alias informatin for gcc).

$ alias gcc
alias gcc='gcc -m64'
$ make
...
make[2]: Entering directory `/home/ft/yxa/build/src/event_handler'
gcc -Wall   -c -o  
  syslog_c-port.o ../../../trunk/src/event_handler/syslog_c-port.c
...

/Fredrik


Reply | Threaded
Open this post in threaded view
|

64-bit erlang

Scott Lystig Fritchie-3
In reply to this post by Kostis Sagonas-3
>>>>> "ks" == Kostis Sagonas <kostis> writes:

ks> Issuing the simple command:

ks> alias gcc='gcc -m64'

ks> would have achieved the same effect.

Here's my reply to Andrae Muys, who suggested using "CC='gcc -m64'
./configure".

  I didn't spend much time on it, but IIRC there was a sub-package that
  assumed that $(CC)'s value contained no whitespace -- the assumption
  was violated, and "make" stopped.  {shrug}  I've run into that quite a
  bit, and I didn't want to discover how many other places made the same
  assumption, so I resorted to my "exec gcc -m64 $*" trick and hoped
  that there weren't any hidden assumptions that $(CC) *arguments*
  didn't contain whitespace & thus break /bin/sh's "$*" expansion.
  There were none, hooray.

The same Makefile assumption about lack-of-whitespace-in-$(CC) is the
same assumption that screws up attempts to use tools like CCache or
DistCC.  "CC='distcc gcc'" or "CC='ccache gcc'" are the easiest ways
to use those tools ... until you encounter a broken Makefile.  Or a
broken "libtool".  {shudder}

-Scott


Reply | Threaded
Open this post in threaded view
|

64-bit erlang

Raimo Niskanen-3
fritchie (Scott Lystig Fritchie) writes:

> >>>>> "ks" == Kostis Sagonas <kostis> writes:
>
> ks> Issuing the simple command:
>
> ks> alias gcc='gcc -m64'
>
> ks> would have achieved the same effect.
>
> Here's my reply to Andrae Muys, who suggested using "CC='gcc -m64'
> ./configure".
>
>   I didn't spend much time on it, but IIRC there was a sub-package that
>   assumed that $(CC)'s value contained no whitespace -- the assumption
>   was violated, and "make" stopped.  {shrug}  I've run into that quite a
>   bit, and I didn't want to discover how many other places made the same
>   assumption, so I resorted to my "exec gcc -m64 $*" trick and hoped

Did you make a two line wrapper a'la:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#! /bin/sh
exec gcc -m64 ${1+"$@"}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In that case note the little improvement to instead of
$* use ${1+"$@"}, that quotes all arguments separately,
and (unimportant for gcc) does not pass an empty
argument if there are none.

That would work even with $(CC) arguments containing whitespace.

>   that there weren't any hidden assumptions that $(CC) *arguments*
>   didn't contain whitespace & thus break /bin/sh's "$*" expansion.
>   There were none, hooray.
>
> The same Makefile assumption about lack-of-whitespace-in-$(CC) is the
> same assumption that screws up attempts to use tools like CCache or
> DistCC.  "CC='distcc gcc'" or "CC='ccache gcc'" are the easiest ways
> to use those tools ... until you encounter a broken Makefile.  Or a
> broken "libtool".  {shudder}
>
> -Scott

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB