Ticket #2043 (closed bug: worksforme)

Opened 11 years ago

Last modified 11 years ago

.loadlib works when compiling, but not when running PBC

Reported by: coke Owned by:
Priority: normal Milestone:
Component: none Version: 3.1.0
Severity: medium Keywords:
Cc: Language: tcl
Patch status: Platform:


The directive:

.loadlib 'bit_ops'

Works at compile time so that the dynamic bit ops are found and the PIR can be compiled.

However, when this is compiled to .pbc, and the pbc is invoked (either directly by parrot or via a pbc2exe executable), the .loadlib directive is not run, so any dynamic compilation from that point on fails.

The workaround for this is to do both:

.sub loadlibs :init
  $P0 = loadlib 'bit_ops'

.loadlib 'bit_ops'

This bug has been impacting partcl-nqp for some time. Haven't bisected.


working_example.pir Download (476 bytes) - added by plobsing 11 years ago.

Change History

Changed 11 years ago by plobsing

Changed 11 years ago by plobsing

  • status changed from new to closed
  • resolution set to worksforme

1) This is not true at the current time. See the attached working_example.pir for dynamic compilation of dynops using only .loadlib forms

2) Dynop availability, while global at the current time, will most likely become lexically scoped at some point. It would be prudent to declare dependancies on dynops in every compilation unit that uses, or may use, them. Unused declared dependancies cost nothing.

Note: See TracTickets for help on using tickets.