Opened 5 years ago

Closed 5 years ago

#52739 closed defect (fixed)

perl5 @5.22.2: build_arch and universal not fully respected

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.

Attachments (3)

Portfile1.diff (1.9 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 5 years ago.
Portfile2.diff (2.2 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 5 years ago.
Portfile3.diff (2.1 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 5 years ago.

Download all attachments as: .zip

Change History (10)

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

Attachment: Portfile1.diff added

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

Attachment: Portfile2.diff added

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

Attachment: Portfile3.diff added

comment:1 Changed 5 years ago by ryandesign (Ryan 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 5 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 5 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:4 in reply to:  2 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to mojca:

So basically you don't care which of the three patches is used if I understand correctly?

Personally, I have no strong feelings about which is best.

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?

I do not believe this would work.
At this point in the Portfile, get_canonical_archflags would not work properly without the workarounds provided earlier.
Further, build_arch would still not be respected.

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

I am not sure why configure.post_args is used.
I do not see the harm, but configure.args seems like a more nature choice.

I would be grateful for a hint how to test building .bundle files.

Personally, I use the command find ./ -name \*.bundle -exec file {} \; in the destroot directory to check to check.

Do any of those patches address #52290?

Since I can not reproduce the exact error, I am not sure.
Based on the error, however, it would seem likely that these two bugs are related.

comment:5 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Is there anything I can do to resolve this ticket?

comment:6 Changed 5 years ago by mojca (Mojca Miklavec)

  • I was trying to address both this ticket and #52290 or at least try to understand whether any of these patches addresses the other bug or not (but the one who reported the problem didn't respond).
  • I still have no clue how to test the .bundle files. To start with, it would help if I knew which port to test.
  • It's not clear to me if we still have issues with MACOSX_DEPLOYMENT_TARGET.

If the first patch woks satisfactory, I would go with the first one (adding lddflags).

comment:7 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

In 041e3a80/macports-ports:

perl5: fully respect build_arch and universal

Fixes #52739

Note: See TracTickets for help on using tickets.