Ticket #312 (closed bug: invalid)

Opened 13 years ago

Last modified 10 years ago

disable static on win32/aix if shared

Reported by: rurban Owned by:
Priority: critical Milestone:
Component: none Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: new Platform: win32

Description (last modified by rurban) (diff)

Having a static and shared libparrot together will lead to unnecessary and very hard to detect conflicts, esp. when being installed together later in the same directory.

On building we seperated them so far into build_dir and blib_dir, but when I moved it together to test make install it lead to TT #276, when parrot picked up the static lib, but the dynamic dynpmc and dynoplibs did not initialize the charset.

So my proposal is:

  • disable static on win32 per default, (check if shared, and disable static then)
    • or rename it to something unique (libparrots.lib)
    • or move it to blib/lib but set blib_dir to . (the current patch I posted)
      Unless --enable-static is requested, embedders or single file solutions might want it.
  • provide --enable-static or --disable-shared Configure.pl options

Details how it worked before:

-W,lblib/lib -lparrot uses the libpath search to find blib/lib/libparrot.lib (the importlib) which finds libparrot.dll (same path as exe).
The dll must reside near the exe unless rpath enabled unices, otherwise we would need a SHRPENV=blib/lib:$PATH macro on every exe invocation in all makefiles. allison didn't like that (perl5 uses that approach), so I moved the dll to the build_dir and everything is fine, even with already installed libparrot.dll. Even with make test. Even with already installed shared libparrot.

But libparrot.lib (or .a) the static lib is also there and will confuse the libpath search when being installed, because then we have a conflict, because the static lib will be found before the importlib, esp. on installed packages.

So I switched locations, moved the static lib to blib/lib and removed the blibdir from the linker libpath (effectively ignoring it). That's when TT#276 appeared.

Attachments

tt312-win32-linking.2.patch Download (15.7 KB) - added by rurban 13 years ago.
tested on freebsd, fixed some omissions
tt312-win32-linking.patch Download (15.7 KB) - added by rurban 13 years ago.
tested on freebsd, fixed some omissions
tt312-win32-linking.3.patch Download (15.7 KB) - added by rurban 13 years ago.
fixed Kein Argument mit Option "/implib:" angegeben

Change History

Changed 13 years ago by rurban

  • status changed from new to assigned
  • description modified (diff)

Changed 13 years ago by rurban

I have a patch to review. It cleans up win32 linking a bit, "does it right now".

Just the post-installed phase is not yet right because libparrot_ldflags is too build_dir specific. dynpmc will fail to link against the installed libparrot importlib/dll.

We either need a seperate dynpmc.pl and dynoplibs.pl tool when installed, or use a run-time lookup to Parrot::Config for a libparrot_ldflags workaround when already being installed.

On non-win32 this is not an issue because there we can easily -Wl,-L$blib_dir -lparrot even when already being installed, because of rpath.

Changed 13 years ago by rurban

tested on freebsd, fixed some omissions

Changed 13 years ago by rurban

tested on freebsd, fixed some omissions

Changed 13 years ago by rurban

fixed Kein Argument mit Option "/implib:" angegeben

Changed 13 years ago by rurban

  • summary changed from disable static on win32 if shared to disable static on win32/aix if shared

Looks like aix also falls into this trap

 http://smolder.plusthree.com/app/public_projects/report_details/18507#first_failure

not ok 1 - loadlib
#   Failed test 'loadlib'
#   at t/dynpmc/dynlexpad.t line 26.
# Exited with error code: [SIGNAL 6]
# Received:
# src/string/api.c:767: failed assertion 'encoding'
# 
# Expected:
# ok
# 
}}}}

Changed 13 years ago by allison

  • milestone 1.1 deleted

Changed 12 years ago by coke

  • status changed from assigned to new
  • owner rurban deleted

Changed 11 years ago by coke

This patch has unfortunately suffered from bitrot and no longer applies cleanly.

Changed 10 years ago by dukeleto

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

Sorry, closing this due to inactivity and lack of a working patch. Please submit a new patch that applies at  https://github.com/parrot/parrot/issues

Note: See TracTickets for help on using tickets.