perlcc makes it big

B

butt-fuzz

I'm running perl 5.8.0 on linux.

I wrote a very simple program:
#!/usr/bin/perl
print "test";

that's it!
and ran perlcc.
it gave me an a.out 1MB in size!
yikes!
 
S

Sundial Services

butt-fuzz said:
I'm running perl 5.8.0 on linux.

I wrote a very simple program:
#!/usr/bin/perl
print "test";

that's it!
and ran perlcc.
it gave me an a.out 1MB in size!
yikes!


That's actually a very common phenomenon. All of these systems come with a
very large foundation... good enough to weather a storm. You simply chose
to build upon it an artifically-small house. In a real world project, the
foundation and what's in it becomes much more realistic. "Making the
world's smallest executable file" is simply not a high-priority objective,
and this choice is made quite consciously.
 
R

Randal L. Schwartz

butt-fuzz> I'm running perl 5.8.0 on linux.
butt-fuzz> I wrote a very simple program:
butt-fuzz> #!/usr/bin/perl
butt-fuzz> print "test";

butt-fuzz> that's it!
butt-fuzz> and ran perlcc.
butt-fuzz> it gave me an a.out 1MB in size!

That seems about right. You have to include all of the Perl engine
to make it work.

What were you actually trying to do?
 
B

butt-fuzz

Bob said:
..............
and compile it. He probably didn't understand that the Perl engine needs to
go along with it.

Bob
oh, yah.

I wanted to convert perl to c/c++.
 
C

Chris Mattern

butt-fuzz said:
oh, yah.

I wanted to convert perl to c/c++.

Then you should know up front that you aren't going to find a program
to do it for you.

Chris Mattern
 
R

Randal L. Schwartz

butt-fuzz> I wanted to convert perl to c/c++.

I guess the real questions are "why" and "have you read the FAQ on that
very item?".

Also "why are you posting behind an alias, because otherwise
I could just ask you this privately instead of making you look
foolish in public?"

print "Just another Perl hacker,"
 
M

Matt H

I'm running perl 5.8.0 on linux.

I wrote a very simple program:
#!/usr/bin/perl
print "test";

that's it!
and ran perlcc.
it gave me an a.out 1MB in size!
yikes!

That's odd, I just ran perlcc on the same program and ended up with
37K (after stripping).
 
T

Tassilo v. Parseval

Also sprach Matt H:
That's odd, I just ran perlcc on the same program and ended up with
37K (after stripping).

That would surprise me:
ethan@ethan:~$ perlcc -e 'print "hello world"'
ethan@ethan:~$ l a.out
-rwxr-xr-x 1 ethan 100 966048 Jul 22 21:59 a.out
ethan@ethan:~$ strip a.out
ethan@ethan:~$ l a.out
-rwxr-xr-x 1 ethan 100 891128 Jul 22 21:59 a.out

So even after stripping it's still 890K in size. Did you perhaps tell
perlcc to do dynamic instead of static linking? If so, how?

Tassilo
 
M

Matt H

So even after stripping it's still 890K in size. Did you perhaps tell
perlcc to do dynamic instead of static linking? If so, how?

I am getting a dynamic a.out. I just used 'perlcc test.pl' to compile
it, no switches were used.
 
J

Juha Laiho

(e-mail address removed)-aachen.de said:
Also sprach Matt H:
That would surprise me:
ethan@ethan:~$ perlcc -e 'print "hello world"' ....
ethan@ethan:~$ strip a.out
ethan@ethan:~$ l a.out
-rwxr-xr-x 1 ethan 100 891128 Jul 22 21:59 a.out

So even after stripping it's still 890K in size. Did you perhaps tell
perlcc to do dynamic instead of static linking? If so, how?

Could this be dependent on Perl compile-time options? I.e. compiling Perl
core as dynamic as opposed to static library (where static at least used
to be the default - I think still with 5.6.1).
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top