Compiling perl with GCC

T

Tim Haynes

[snip]
#make test
`sh cflags "optimize='-03'" toke.o` toke.c
CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -03 -wall
gcc: Internal Error: Terminated (program cc1)
Please submit a full bug report. [snip]

Any ideas? It seems vague and doesn't give me much of a clue.

First of all, try it without the -O3 in there. -O2 is probably all you
need, or take it out altogether.

~Tim
--
Product Development Consultant
OpenLink Software
Tel: +44 (0) 20 8681 7701
Web: <http://www.openlinksw.com>
Universal Data Access & Data Integration Technology Providers
 
M

Marcus

I was unable to compile some perl modules, because after running #perl
Makefile.PL running #make was trying to call up /usr/bin/cc rather than
gcc.

After looking at newsqroups I got the impression that I needed to either
purchase the commercial sun compiler that uses the cc command or
recompile perl from source using gcc (my current perl was already
installed as part of the linux install).

So being unable to justify the expense of the first option, I went for
the second.

#./Configure went through seemingly fine. When I ran #make or #make test
though I ran into errors.

------------------------------------------------------------------------
#make test
`sh cflags "optimize='-03'" toke.o` toke.c
CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -03 -wall
gcc: Internal Error: Terminated (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make: *** [toke.o] Error 1
#
------------------------------------------------------------------------

Any ideas? It seems vague and doesn't give me much of a clue.

I haven't submitted a full bug report. I haven't got all the information
asked for. For instance my GCC was installed from an RPM (I didn't have
a compiler before that), so I don't know all the configure options used.

I am running GCC 3.3.1 on Peanut Linux 9.5 with kernel 2.4.20. Trying to
compile perl 5.8.0 from source having gone through configure using
default options apart from one minor change to a path setting.

Regards,

Marcus Thornton.
 
M

Marcus

[snip]
#make test
`sh cflags "optimize='-03'" toke.o` toke.c
CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -03 -wall
gcc: Internal Error: Terminated (program cc1)
Please submit a full bug report. [snip]

Any ideas? It seems vague and doesn't give me much of a clue.

First of all, try it without the -O3 in there. -O2 is probably all you
need, or take it out altogether.

~Tim


OK tried changing the -03 in the makefile to -02 and it looked better
and got further, checking file dependencies, but then produced the same
line as before (except obviously with -02 instead of -03) before
producing the same error.

Thank you, but any more ideas?

Regards,

Marcus Thornton.
 
J

Juha Laiho

Marcus said:
OK tried changing the -03 in the makefile to -02 and it looked better

Note, the optimization option is -O2, not -02.
Thank you, but any more ideas?

Check if there's any later gcc RPM for your distribution. Though what
you have seems pretty recent already.

Note that you can't safely mix&match RPMs from different distributions,
so even through you might be succesful in installing an RPM meant
for some other distribution, there's no guarantee it'll work properly.
 
M

Marcus

Note, the optimization option is -O2, not -02.


Check if there's any later gcc RPM for your distribution. Though what
you have seems pretty recent already.

Note that you can't safely mix&match RPMs from different distributions,
so even through you might be succesful in installing an RPM meant
for some other distribution, there's no guarantee it'll work properly.

Yes it was -O2 not -02 I used, sorry for the typo. Using the trial and
error method -O1 seemed to work, which is slightly bizarre given that
later reading revealed that there isn't an -O1 option!!!!

Anyway make test went through to the end. At which point I was told that
I'd failed just one of the tests. I was advised to set LD_LIBRARY_PATH
to include the build directory and then run ./perl harness.

I did this and was hit with this report:-
----------------------------------------------------------------------
Failed test ../lib/Net/t/hostname.t Total 2 Fail 1 Failed 50.00%
List of Failed 1

41 tests and 410 tests skipped.
Failed 1 out of 712 test scripts, 99.86% okay. 1/68623 subtests failed,
100.00% Okay.
----------------------------------------------------------------------

I found a newsgroup featuring somebody who had exactly this test failed
at 50% and they said that they fixed it by setting the reverse DNS up.

Thing is I don't even have forward DNS set up. I have a file /etc/hosts
which provides hostname to address mapping for the TCP/IP subsystem and
says it can be used on small systems instead of a "named" name server.

Do I need to set my machine up as a name server? If so which is the
simplest way to do it or do I need to go the whole hog and install bind
or some such?

I would be loath to go to the lengths of compiling and installing yet
another indepth piece of software. A fortnight ago I'd never seen a
linux prompt and decided I needed to set a box up as a proxy and mail
server. Every time I try to install something though, there seems to be
five things that it depends on that need installing first. All of which
seem to my novice eyes to be tricky. Hence my aversion to tackling bind
at this point.

So what is the simplest way to set up the reverse DNS?

Regards,

Marcus Thornton.
 
S

Sisyphus

Marcus said:
I was unable to compile some perl modules, because after running #perl
Makefile.PL running #make was trying to call up /usr/bin/cc rather than
gcc.

This happens presumably because 'perl -V:cc' reports 'cc' - which means
that cc is the appropriate compiler to use with this build of perl.
I gather you don't have cc installed - but it should be available from
the OS installation discs.
At least it's on my (Mandrake) linux pc and I certainly didn't purchase
it or download it over the web.

Afaik, neither cc nor gcc is part of the standard install - when I
installed gcc from the installation disks, cc mysteriously appeared also.

All I'm getting at is that it might be simpler for you to install cc and
stay with the existing perl installation *if* there's no other problems
with it.

The perl that came with my Linux is missing the CORE/ files - so I
installed another perl (running as a user, but I needed to run 'make
install' as root). Now I have 2 - the one that came with the OS (and
gets found by the OS or whenever I run as root), and the one I installed
(and gets found when I run as a user).

Sounds like you're trying to replace the original. Running as a user, I
had no problem in getting perl to build with both cc and gcc. I'm new to
Linux, and don't know which is the most appropriate course of action to
take. Just thought I'd throw this is in to give you something else to
think about (which I'm sure you need :), and to see if someone has some
comments and advice that might lead to *my* edification, too.

Cheers,
Rob
 
J

Juha Laiho

Marcus said:
Anyway make test went through to the end. At which point I was told that
I'd failed just one of the tests. I was advised to set LD_LIBRARY_PATH
to include the build directory and then run ./perl harness.

I did this and was hit with this report:-
----------------------------------------------------------------------
Failed test ../lib/Net/t/hostname.t Total 2 Fail 1 Failed 50.00%
List of Failed 1

41 tests and 410 tests skipped.
Failed 1 out of 712 test scripts, 99.86% okay. 1/68623 subtests failed,
100.00% Okay.

Ok. Then you should be able to trust that perl in itself is working.
So what is the simplest way to set up the reverse DNS?

Perl as such does not require reverse DNS - and even though the test
failed, you should be able to install the compilation results.

So, just go on and install - as you've identified that the cause of
problem is not with perl, and doesn't cripple your environment.
 
Joined
Sep 27, 2013
Messages
1
Reaction score
0
Hi everyone,

I am looking to change 'perl -V:cc' reports 'cc' to 'gcc' but I cannot seem to figure out how. Can someone assist with how to change perl's compiler to gcc?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top