Opened 8 years ago

Last modified 7 years ago

#52739 closed defect

perl5 @5.22.2: build_arch and universal not fully respected — at Version 3

Reported by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) Owned by: mojca@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: larryv (Lawrence Velázquez), dbevans (David B. Evans)
Port: perl5

Description (last modified by mojca (Mojca Miklavec))

The .bundle files are not built with arch flags, so they do not respect build_arch and are not built universal.
Attached are several proposed solutions.

  • Portfile1.diff adds -Alddlflags="$LDFLAGS" to configure.post_args. It adds the arch flags, but it also adds -L/opt/local/lib -Wl,-headerpad_max_install_names, which might not be desirable.
  • Portfile2.diff and Portfile3.diff just add "-Alddlflags=\"[get_canonical_archflags ld]\"" to configure.post_args. Extra code, however, is required to make get_canonical_archflags work correctly. get_canonical_archflags determines if universal flags are required using the following code:
    if {![variant_exists universal] || ![variant_isset universal]} {
    
    When configure.post_args-append is run, however, the universal variant has not yet been created. I assume this is to give the Portfile a chance to create its own.

Change History (6)

Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile1.diff added

Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile2.diff added

Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile3.diff added

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Option 1 looks good to me. Using -headerpad_max_install_names is always good. Using -L/opt/local/lib can very occasionally be problematic; I don't know if it is problematic for perl.

comment:2 Changed 8 years ago by mojca (Mojca Miklavec)

Cc: larryv dbevans added
Version: 2.3.4

Thansk a lot for explanation. So basically you don't care which of the three patches is used if I understand correctly?

Portfile2.diff and Portfile3.diff just add "-Alddlflags=\"[get_canonical_archflags ld]\"" to configure.post_args. Extra code, however, is required to make get_canonical_archflags work correctly. get_canonical_archflags determines if universal flags are required using the following code:

if {![variant_exists universal] || ![variant_isset universal]} {

When configure.post_args-append is run, however, the universal variant has not yet been created. I assume this is to give the Portfile a chance to create its own.

I would imagine that a more logical solution than to create a variant manually or to put the code inside the pre-configure {} block would be to use

if {[variant_isset universal]} {
    configure.post_args-append "-Alddlflags=\"[get_canonical_archflags ld]\""
}

Does that work properly?

Just curious, what's the difference (if any) between configure's post-args and args? Why not appending it simply to args?

Regarding the MACOSX_DEPLOYMENT_TARGET:

The perl port already handles it in a much better way with:

-Dld="env MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $CC”

Sorry for not seeing this earlier.

Well, no, I just removed it in r154367 because I thought it was handled properly by the new patches. I wouldn't mind filing another "bug report" with a patch upstream though that would fix this for older OSes in case it's broken there. What's the easiest way to test?

A few bonus questions:

  • I would be grateful for a hint how to test building .bundle files.
  • Do any of those patches address #52290?
  • Unrelated: We've been asked to test whether perl built specifically on 10.12 with MACOSX_DEPLOYMENT_TARGET set to support an earlier OS actually works on that older OS. If anyone is eager to test that, I would be grateful.

comment:3 Changed 8 years ago by mojca (Mojca Miklavec)

Description: modified (diff)
Note: See TracTickets for help on using tickets.