Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#15033 closed enhancement (fixed)

make openssl universal_archs-aware

Reported by: jmroot (Joshua Root) Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: ryandesign (Ryan Carsten Schmidt)
Port: openssl

Description

The attached patch makes openssl respect the universal_archs variable if it is set. There is still one major issue when building for both 32- and 64-bit: there will be differences in the opensslconf.h that is generated. It should be possible to merge them with the addition of appropriate #ifdefs, but I'm not sure how best to go about doing that.

Attachments (4)

openssl-universal_archs.diff (5.3 KB) - added by jmroot (Joshua Root) 16 years ago.
patch-opensslconf.h-32.diff (1.4 KB) - added by jmroot (Joshua Root) 16 years ago.
patch-opensslconf.h-ppc64.diff (1.4 KB) - added by jmroot (Joshua Root) 16 years ago.
patch-opensslconf.h-x86_64.diff (1.4 KB) - added by jmroot (Joshua Root) 16 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 17 years ago by jmroot (Joshua Root)

Updated to apply an appropriate patch to each copy of opensslconf.h in order to make them identical yet still correct on each arch. This seems to work OK, and should continue to do so as long as opensslconf.h doesn't change too much.

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

This looks good, except that it doesn't work on MacPorts 1.6.0 (says Error: Target org.macports.patch returned: can't read "universal_archs": no such variable), and the patch uses inconsistent whitespace for indentation.

I'll attach a revised patch which:

  • uses consistent tab indentation to match the portfile
  • sets universal_archs outside of the universal variant so it's set when the other phases come around
  • uses curly braces around all variable references
  • abstracts out the one change in the three ./Configure invocations into a new variable ${my_cc} and calls ./Configure in just one place

Problems that still remain:

  • the part that searches for differences between files assumes "i386" is among the requested architectures (not necessarily so if the user modified universal_archs)
  • the part that searches for differences between files checks for differences between "i386" and "i386" which it needn't do

The ${first_arch} code in the cairo port's universal variant may be helpful. (Note that the cairo port's universal variant is not working in cairo 1.6.4, but the mechanism is sound since it did work in 1.4.14. See #15451.)

comment:3 Changed 16 years ago by jmroot (Joshua Root)

Cc: ryandesign@… added

Updated for openssl 0.9.8h. (I was in the middle of doing this when you posted you comment, Ryan, but it looks like you have some other fixes as well.)

comment:4 Changed 16 years ago by jmroot (Joshua Root)

I also fixed the indentation and the location of the universal_archs definition, BTW.

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Improvements in my second patch (w.r.t. my first patch):

  • uses --no-backup-if-mismatch on the patch command, because jmr's new patch does (why?)
  • borrows the ${first_arch} code from the cairo port
    • saves a copy during the post-patch phase
    • saves a diff during the diff phase
    • diffs correctly even if the user did not request the i386 arch

Problems remaining: the patch fails when I request all four architectures?

Error: Target org.macports.destroot returned: shell command "cd /opt/local/var/macports/build/_Users_rschmidt_macports_dports_devel_openssl/work/pre-dest/ppc64/opt/local && patch --no-backup-if-mismatch -p0 < /Users/rschmidt/macports/dports/devel/openssl/files/patch-opensslconf.h-64.diff" returned error 1
Command output: patching file include/openssl/opensslconf.h
Hunk #1 FAILED at 134.
Hunk #3 FAILED at 180.
2 out of 3 hunks FAILED -- saving rejects to file include/openssl/opensslconf.h.rej

comment:6 in reply to:  5 Changed 16 years ago by jmroot (Joshua Root)

Replying to ryandesign@macports.org:

  • uses --no-backup-if-mismatch on the patch command, because jmr's new patch does (why?)

After updating to 0.9.8h, the patches were applying cleanly but with a few lines' offset. Patch defaults to creating a .orig in this case, which of course is different for each arch and causes the merge to fail.

Not sure what's going on with ppc64.

comment:7 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Gotcha (re: --no-backup-if-mismatch)

I'm attaching the four opensslconf.h files. Looks like there are three versions: one for ppc and i386, one for ppc64, and one for x86_64.

Changed 16 years ago by jmroot (Joshua Root)

Changed 16 years ago by jmroot (Joshua Root)

Attachment: patch-opensslconf.h-32.diff added

Changed 16 years ago by jmroot (Joshua Root)

Changed 16 years ago by jmroot (Joshua Root)

comment:8 Changed 16 years ago by jmroot (Joshua Root)

Port: openssl added

Updated patches attached. Now works with ppc64.

comment:9 Changed 16 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Committed in r41928 (maintainer timeout).

comment:10 Changed 16 years ago by (none)

Milestone: Port Enhancements

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.