Ticket #3608 (new defect)

Opened 2 months ago

Last modified 3 weeks ago

DL name mangling interferes with loading PCC compiled shared objects

Reported by: FrostyCookie Assigned to: anonymous
Priority: high Milestone:
Component: Runtime Version: trunk
Severity: block Keywords: dl library
Cc:

Description

Given a shared object compiled with pcc named:

ws5:/home/david/roadsend/tests# find . -name libfuncs* ./lib/libfuncs_s-3.0c.so

When we try to load it we get:

ws5:/home/david/roadsend/tests# pcc -d 1 -f test.php >>> dl: module-name -> libfuncs-s-3.0c.so ext-name -> libfuncs-s-3.0c (dyn-load-path: (/usr/local/etc ./ /usr/local/lib /usr/local/etc/libs /usr/local/lib ./ /usr/local/lib ./ /usr/local/etc /usr/bin/X11 /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin .))

LD_LIBRARY_PATH is: /usr/local/lib:/home/david/roadsend/tests/lib/ dynamic-load-path is: (/usr/local/etc ./ /usr/local/lib /usr/local/etc/libs /usr/local/lib ./ /usr/local/lib ./ /usr/local/etc /usr/bin/X11 /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin .)

Warning: dl(): Unable to load extension libfuncs-s-3.0c.so in /home/david/roadsend/tests/test.php on line 3

Fatal error: lookup-function - undefined function: HelloWorld? in /home/david/roadsend/tests/test.php on line 4

Which seems to be due to the name mangling.

Test case:

"Lib source":

ws5:/home/david/roadsend/tests# cat lib/funcs.php <?php

function HelloWorld?( ) {

print "Hello world\n";

}

?>

Use case:

ws5:/home/david/roadsend/tests# cat test.php <?php

dl("libfuncs_s-3.0c.so"); HelloWorld?();

?>

Not the most exciting example on the planet.

Change History

10/29/08 09:47:11 changed by

  • milestone deleted.

Milestone 2.9.7 deleted