LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LFS Perl-5.24.1 Make Error 2 (https://www.linuxquestions.org/questions/linux-newbie-8/lfs-perl-5-24-1-make-error-2-a-4175608337/)

1993istheend 06-21-2017 03:44 PM

LFS Perl-5.24.1 Make Error 2
 
Hello all,

I've tried making an LFS system before and have made it further this time than any other, but I've hit a snag at making Perl.

opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lm /tools/lib/libcrypt.a
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
./miniperl -Ilib -f write_buildcustomize.pl
Invalid \0 character in pathname for require: strict.pm\0 at write_buildcustomize.pl line 3.
Can't locate strict.pm: No such file or directory at write_buildcustomize.pl line 3.
BEGIN failed--compilation aborted at write_buildcustomize.pl line 3.
make: *** [makefile:385: lib/buildcustomize.pl] Error 2

Does anyone have any ideas to fix this?

Thanks.

AwesomeMachine 06-21-2017 08:01 PM

Afaik, Error 2 just means the build aborted. Try editing the make file compiler switches to turn all errors into warnings, and remove compiler optimizations. You also might be missing certain c++ headers.

This also might help: https://rt.perl.org/Public/Bug/Display.html?id=131415

1993istheend 06-21-2017 08:21 PM

Which switch would that be?

1993istheend 06-21-2017 11:26 PM

So I prepared for the build of perl as the book says, using make -w instead and got the same result.

grail 06-22-2017 12:08 AM

The usual answer is that you have missed something, however, as the error is very specific, have you checked write_buildcustomize.pl to search for strict.pm and see if there are any invalid characters?
Could be the file was not downloaded correctly and somehow this file has truncated data??

AwesomeMachine 06-22-2017 03:54 AM

Gcc and g++
 
Quote:

Originally Posted by 1993istheend (Post 5725398)
Which switch would that be?

The Linux compilers have many options. But if you're building your own brew you have to learn the common ones.

I don't know which are in the makefile you have. But you should have a look at the man page for gcc. It also could be that the error message states the actual cause of the error, in which case you can do as grail wrote above.

1993istheend 06-22-2017 04:32 PM

Here is the output for the first part of write_buildcustomize.pl:

#!./miniperl -w

use strict;

my $osname = $^O;
my $file = 'lib/buildcustomize.pl';

if ( @ARGV % 2 ) {
my $dir = shift;
chdir $dir or die "Can't chdir '$dir': $!";
unshift @INC, 'lib';
}

if ( @ARGV ) {
# Used during cross-compilation.
$osname = $ARGV[1];
}


The error says something is missing in line 3, but I'm not sure what.

EDIT: I figured I'd look for strict.pm but it's not in my source for perl-5.24.1, although I do have it on the host machine.

AwesomeMachine 06-22-2017 05:33 PM

I think this is what its complaining about:
Code:

$^O

1993istheend 06-22-2017 05:37 PM

Should I comment that line out?

grail 06-23-2017 01:13 AM

You would probably need to check where $osname is being used. I would add that at the point you are in the build it WILL still be using the host systems copy of perl to support the 'use' call.
So strict.pm will be the one from your host system.

Luridis 06-24-2017 10:10 AM

"^O" gets the name of the current operating system inside a Perl script. The fact that it is complaining of an invalid character coming from ^O may mean that Unicode is getting in there. I would try:

Code:

(Assuming you're in chapter 5.)
LC_CTYPE=en_US.UTF-8 sh Configure -des -Dprefix=/tools -Dlibs=-lm
LC_CTYPE=en_US.UTF-8 make

Replacing "en_US" with your actual locale, and see if that works.

1993istheend 06-26-2017 03:40 PM

Quote:

Originally Posted by Luridis (Post 5726605)
"^O" gets the name of the current operating system inside a Perl script. The fact that it is complaining of an invalid character coming from ^O may mean that Unicode is getting in there. I would try:

Code:

(Assuming you're in chapter 5.)
LC_CTYPE=en_US.UTF-8 sh Configure -des -Dprefix=/tools -Dlibs=-lm
LC_CTYPE=en_US.UTF-8 make

Replacing "en_US" with your actual locale, and see if that works.

This would be before the make command in the perl section of chapter 5?

EDIT: I saw that these commands were similar to the ones in the book, I ran them and ended up with the same error. I may just start over.

1993istheend 06-26-2017 04:01 PM

I did seem to see more errors this time though:

cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lm /tools/lib/libcrypt.a
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
Invalid \0 character in pathname for open: /dev/null\0.
Can't open /dev/null: No such file or directory
Failed to build miniperl. Please run make minitest
make: *** [makefile:384: lib/buildcustomize.pl] Error 1
lfs@tcc-AOD255E:/mnt/lfs/sources/perl-5.24.1$ make minitest
cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o miniperlmain.o -lm /tools/lib/libcrypt.a
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
./miniperl -Ilib -f write_buildcustomize.pl
Invalid \0 character in pathname for require: strict.pm\0 at write_buildcustomize.pl line 3.
Can't locate strict.pm: No such file or directory at write_buildcustomize.pl line 3.
BEGIN failed--compilation aborted at write_buildcustomize.pl line 3.
make: *** [makefile:385: lib/buildcustomize.pl] Error 2

Luridis 06-26-2017 07:27 PM

LC_CTYPE=<your locale> (commands)

Indicates you want to run (commands) with the CTYPE of a different locale than you're using. The strict.pm\0 is an indication that you're system isn't reading the line with the correct character set. There are numbers there it doesn't understand the purpose of and that's what's getting translated into "\0" by the system library.

Are you using ssh? A non-us locale or keyboard? Was your LC_ALL set to POSIX in chapter 5?


All times are GMT -5. The time now is 01:39 PM.