Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#57606 closed defect (fixed)

nss @3.40 does not build on PPC Tiger, Mac OS X 10.4.11, with HFSX because 'for' loop initial declaration used outside C99 mode

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger Cc:
Port: nss

Description

/opt/local/bin/gcc-apple-4.2 -arch ppc -o Output.OBJD/tls13esni.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK  -Wall -Wshadow -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss  tls13esni.c
tls13esni.c: In function 'tls13_CopyESNIKeys':
tls13esni.c:72: error: 'for' loop initial declaration used outside C99 mode
tls13esni.c: In function 'SSLExp_EncodeESNIKeys':
tls13esni.c:288: error: 'for' loop initial declaration used outside C99 mode
make[2]: *** [Output.OBJD/tls13esni.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.40/nss/lib/ssl'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.40/nss/lib'
make: *** [libs] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.40/nss'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.40/nss" && /usr/bin/make -w all NSS_DISABLE_GTESTS=1 NSS_ENABLE_WERROR=0 CC="/opt/local/bin/gcc-apple-4.2 -arch ppc" CCC="/opt/local/bin/g++-apple-4.2 -arch ppc" NSPR_INCLUDE_DIR=/opt/local/include/nspr NSPR_LIB_DIR=/opt/local/lib/nspr NSS_USE_SYSTEM_SQLITE=1 USE_SYSTEM_ZLIB=1 BUILD_OPT=1 OPTIMIZER="-Os" OBJDIR_NAME="Output.OBJD" 
Exit code: 2

Attachments (1)

main.log (324.3 KB) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
Main.log from build on PowerPC 7447A

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from build on PowerPC 7447A

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

That should be easy to fix, either by telling the build to use c99 mode, or by moving the variable declaration to the top of the function. In any case, it is not a MacPorts-specific problem and should be reported directly to the developers of nss so that they can fix it using the method they prefer.

comment:2 Changed 6 years ago by kencu (Ken)

The nss Portfile contains this block, which doesn't really work for the gcc-built software using gcc6:

# blacklist old compilers that don't understand -std=c++0x
# to fix build on 10.6 and earlier
# https://trac.macports.org/ticket/51196

compiler.blacklist  *gcc* {clang < 300}

This should be upgraded to something more current, but I wouldn't bother as we have an impending extensive update to compiler selection in the pipeline that will soon make a lot of this (all of this?) obsolete <https://github.com/macports/macports-base/pull/88>.

So for today, just replace that line on Tiger/Leopard PPC with

PortGroup cxx11 1.1

and you're done for now.

$ port -v installed nss
The following ports are currently installed:
  nss @3.40_0 (active) platform='darwin 8' archs='ppc' date='2018-11-15T11:19:16-0800'

It can be looked at again someday when the compiler selection logic is committed

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:3 in reply to:  2 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

PortGroup cxx11 1.1

This worked!

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

Owner: set to ryandesign
Status: newaccepted

Duplicate #57971 says using -std=c99 worked, but that surprises me. As Ken pointed out above, the port blacklists compilers that don't understand -std=c++0x. No compiler on Tiger understands c++0x, which leads to the message All compilers are either blacklisted or unavailable; defaulting to first fallback option. So either the software no longer requires c++0x and we should remove that blacklisting and add -std=c99 and inform the developers of that, or the software still does require c++0x in which case we should remove the custom blacklisting and use the cxx11 1.1 portgroup. I will investigate.

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

c++0x was only used by the tests, which the port disables. It builds fine on Tiger PowerPC with -std=c99 added. I am working on updating the port. This should close most of the open tickets about nss.

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

Resolution: fixed
Status: acceptedclosed

In dc8cb172c0781c762f354ab68f53180133af384f/macports-ports (master):

nss: Use c99 mode

Fixes build failure when compilers that default to c89 mode are used.

Closes: #57606

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

In 9ed67f728d092126e49bf20cad5024b8e0a516b2/macports-ports (master):

nss: Don't require a C++11 compiler

C++11 is only needed by the tests, which the port disables.

See: #57606

Note: See TracTickets for help on using tickets.