Opened 11 years ago

Closed 11 years ago

#40082 closed defect (fixed)

certsync: build fails on Leopard and Tiger

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: landonf (Landon Fuller)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: leopard tiger haspatch Cc: cooljeanius (Eric Gallager), nonstop.server@…
Port: certsync

Description

Building certsync fails on Leopard PowerPC:

:notice:build --->  Building certsync
:debug:build Executing org.macports.build (certsync)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m: In function ‘PLCFAutorelease’:
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:60: error: nested functions are disabled, use -fnested-functions to re-enable
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pred’
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:60: error: ‘pred’ undeclared (first use in this function)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:60: error: (Each undeclared identifier is reported only once
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:60: error: for each function it appears in.)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:61: warning: implicit declaration of function ‘dispatch_once’
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:61: error: expected expression before ‘^’ token
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m: In function ‘certificatesForTrustDomain’:
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:121: error: ‘errSecSuccess’ undeclared (first use in this function)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m: In function ‘exportCertificates’:
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:228: error: ‘SecCertificateCopyShortDescription’ undeclared (first use in this function)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:229: warning: implicit declaration of function ‘SecCertificateCopyShortDescription’
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:229: warning: passing argument 1 of ‘PLCFAutorelease’ makes pointer from integer without a cast
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:231: warning: implicit declaration of function ‘SecCertificateCopySubjectSummary’
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:231: warning: passing argument 1 of ‘PLCFAutorelease’ makes pointer from integer without a cast
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:254: error: ‘SecItemExport’ undeclared (first use in this function)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:255: warning: implicit declaration of function ‘SecItemExport’
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:264: error: ‘errSecSuccess’ undeclared (first use in this function)
:info:build /Volumes/Data/macports/dports/security/certsync/files/certsync.m:274: error: ‘NSDataWritingAtomic’ undeclared (first use in this function)
:info:build Command failed: /usr/bin/gcc-4.2  -Os  -mmacosx-version-min=10.6  -Wall  /Volumes/Data/macports/dports/security/certsync/files/certsync.m -o /Volumes/Data/macports/leopard/var/macports/build/_Volumes_Data_macports_dports_security_certsync/certsync/work/certsync-1.0.3/certsync  -L/Volumes/Data/macports/leopard/lib -Wl,-headerpad_max_install_names  -arch ppc  -framework Foundation -framework Security -framework CoreServices
:info:build Exit code: 1

Attachments (2)

main.log (6.1 KB) - added by ryandesign (Ryan Carsten Schmidt) 11 years ago.
certsync.m.diff (2.5 KB) - added by danielluke (Daniel J. Luke) 11 years ago.

Download all attachments as: .zip

Change History (19)

Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:1 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:2 Changed 11 years ago by nonstop.server@…

Cc: nonstop.server@… added

Cc Me!

comment:3 Changed 11 years ago by landonf (Landon Fuller)

Is 10.6 still officially supported? I can probably get this working if I get a 10.6 VM running, but it won't be pretty.

comment:4 Changed 11 years ago by landonf (Landon Fuller)

Just looked at this more closely; the code that's triggering the error is guarded by:

  #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6

This shouldn't be triggering on 10.6 at all.

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

Leopard is 10.5, not 10.6. Leopard is the last OS that runs on PowerPC Macs. I still try to make my ports work on Leopard and Tiger.

comment:6 Changed 11 years ago by landonf (Landon Fuller)

Sorry, the marketing names all mushed together in my head once they started re-using them with cat prefixes.

I just committed a fix for PLCFAutorelease() in r109343; that part *should* now work on 10.5. SecCertificateCopyShortDescription() is still a question mark, as that code *is* guarded by a MAC_OS_X_VERSION_MAX_ALLOWED check for the SDK version.

I don't have anything capable of running 10.5 even if I had a copy, so I'm flying a bit blind here, but I don't think there's anything that should prevent its working.

comment:7 Changed 11 years ago by danielluke (Daniel J. Luke)

Still fails:

DEBUG: Executing org.macports.build (certsync)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m: In function ‘certificatesForTrustDomain’:
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:113: error: ‘errSecSuccess’ undeclared (first use in this function)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:113: error: (Each undeclared identifier is reported only once
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:113: error: for each function it appears in.)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m: In function ‘exportCertificates’:
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:220: error: ‘SecCertificateCopyShortDescription’ undeclared (first use in this function)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:221: warning: implicit declaration of function ‘SecCertificateCopyShortDescription’
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:221: warning: passing argument 1 of ‘PLCFAutorelease’ makes pointer from integer without a cast
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:223: warning: implicit declaration of function ‘SecCertificateCopySubjectSummary’
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:223: warning: passing argument 1 of ‘PLCFAutorelease’ makes pointer from integer without a cast
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:246: error: ‘SecItemExport’ undeclared (first use in this function)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:247: warning: implicit declaration of function ‘SecItemExport’
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:256: error: ‘errSecSuccess’ undeclared (first use in this function)
/opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m:266: error: ‘NSDataWritingAtomic’ undeclared (first use in this function)
Command failed: /usr/bin/gcc-4.2  -Os  -mmacosx-version-min=10.6  -Wall  /opt/local/var/macports/sources/rsync.macports.org/release/ports/security/certsync/files/certsync.m -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_security_certsync/certsync/work/certsync-1.0.4/certsync  -L/opt/local/lib -Wl,-headerpad_max_install_names  -arch ppc  -framework Foundation -framework Security -framework CoreServices
Exit code: 1

comment:8 Changed 11 years ago by landonf (Landon Fuller)

The additional failures are still expected, I just don't know how to fix them without a 10.5 machine handy. The SecCertificateCopyShortDescription call, for example, is guarded via MAC_OS_X_VERSION_MAX_ALLOWED. If you could take a peek to figure out why that's working on 10.6 or 10.5, might be able to fix that too.

comment:9 Changed 11 years ago by danielluke (Daniel J. Luke)

yeah, I've almost got it to build with stupid hacks. I don't have a 10.6 machine to test on, but I do have 10.5/ppc around. I don't think MAC_OS_X_VERSION_10_6 is defined when building on 10.5, though.

I'll post something here once I get it to build (or if I give up ;-) ).

comment:10 Changed 11 years ago by danielluke (Daniel J. Luke)

attached patch that builds and appears to run OK on 10.5

  • #define errSecSuccess
  • #if 0 instead of trying to use Availability Macros
  • SecCertificateCopySubjectSummary isn't on 10.5, use SecCertificateCopyCommonName instead and ignore the fact that some certs don't have a Common Name set
  • alternate NSData method (writeToFile:options:error not available on 10.5

Changed 11 years ago by danielluke (Daniel J. Luke)

Attachment: certsync.m.diff added

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

Keywords: leopard tiger haspatch added
Summary: certsync: build failscertsync: build fails on Leopard and Tiger

It does build on Leopard with that patch; thanks. I still see "-mmacosx-version-min=10.6" in the build phase and am not sure what effect that has.

comment:12 in reply to:  9 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to dluke@…:

I don't think MAC_OS_X_VERSION_10_6 is defined when building on 10.5, though.

I believe that's correct. You cannot use the constant MAC_OS_X_VERSION_10_Y if you are running on OS X version 10.Z if Y > Z.

comment:13 in reply to:  10 Changed 11 years ago by landonf (Landon Fuller)

Replying to dluke@…:

attached patch that builds and appears to run OK on 10.5

  • #define errSecSuccess
  • #if 0 instead of trying to use Availability Macros
  • SecCertificateCopySubjectSummary isn't on 10.5, use SecCertificateCopyCommonName instead and ignore the fact that some certs don't have a Common Name set
  • alternate NSData method (writeToFile:options:error not available on 10.5

I made a go of incorporating these changes in certsync 1.0.5, with some minor tweaks. They build+run on my 10.8 system; can you test them out on 10.5 when you get a chance? Thanks!

comment:14 Changed 11 years ago by danielluke (Daniel J. Luke)

If I change -mmacosx-version-min=10.6 to -mmacosx-version-min=10.5 in the Portfile, then it builds and runs OK.

comment:15 in reply to:  14 ; Changed 11 years ago by landonf (Landon Fuller)

Replying to dluke@…:

If I change -mmacosx-version-min=10.6 to -mmacosx-version-min=10.5 in the Portfile, then it builds and runs OK.

Awesome, thanks! I knew I was forgetting something, fixed in r109460. I think this might actually run as far back as 10.2, but I'm guessing nobody has that around to test.

comment:16 in reply to:  15 Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to landonf@…:

Replying to dluke@…:

If I change -mmacosx-version-min=10.6 to -mmacosx-version-min=10.5 in the Portfile, then it builds and runs OK.

Awesome, thanks! I knew I was forgetting something, fixed in r109460. I think this might actually run as far back as 10.2, but I'm guessing nobody has that around to test.

I have 10.3 around still... It's been a while since I've used that computer though...

comment:17 Changed 11 years ago by landonf (Landon Fuller)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.