Opened 8 years ago

Closed 6 years ago

#51709 closed defect (duplicate)

nss @3.23 does not build on PPC Tiger, Mac OS X 10.4.11 because wrong types are used?

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: nss

Description

This is the error:

:info:build /opt/local/bin/clang-mp-3.3 -arch ppc -o Output.OBJD/Darwin_SINGLE_SHLIB/pqg.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK  -Wall -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds  -Werror -DXP_UNIX -DSHLIB_SUFFIX=\"dylib\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DMP_API_COMPATIBLE -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -Impi -Iecl  pqg.c
:info:build pqg.c:339:16: error: comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
:info:build     if (addend < MP_DIGIT_MAX) {
:info:build         ~~~~~~ ^ ~~~~~~~~~~~~
:info:build 1 error generated.
:info:build make[3]: *** [Output.OBJD/Darwin_SINGLE_SHLIB/pqg.o] Error 1
:info:build make[3]: 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.23/nss/lib/freebl'
:info:build make[2]: *** [libs] Error 2

The definition of MP_DIGIT_MAX comes from

# 81 "mpi/mpi.h"
typedef unsigned long long mp_digit;
#define MP_DIGIT_MAX MP_ULONG_LONG_MAX

i.e. /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/lib/freebl/mpi/mpi.h, addend is declared as unsigned long addend. So giving it the correct type should correct the issue:

/opt/local/bin/clang-mp-3.3 -arch ppc -o Output.OBJD/Darwin_SINGLE_SHLIB/pqg.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK  -Wall -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds  -Werror -DXP_UNIX -DSHLIB_SUFFIX=\"dylib\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DMP_API_COMPATIBLE -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -Impi -Iecl  pqg.c

(The patch file is uploaded.) This fix expoeses a new fault:

/opt/local/bin/clang-mp-3.3 -arch ppc -o Output.OBJD/Darwin_SINGLE_SHLIB/ecl_gf.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK  -Wall -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds  -Werror -DXP_UNIX -DSHLIB_SUFFIX=\"dylib\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DMP_API_COMPATIBLE -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -Impi -Iecl  ecl/ecl_gf.c
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/.tmp/ecl_gf-Ll1z35.s:852:Parameter error: r0 not allowed for parameter %lu (code as 0 not r0) (parameter 2)
/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/.tmp/ecl_gf-Ll1z35.s:906:Parameter error: r0 not allowed for parameter %lu (code as 0 not r0) (parameter 2)
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
make[3]: *** [Output.OBJD/Darwin_SINGLE_SHLIB/ecl_gf.o] Error 1
make[3]: 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.23/nss/lib/freebl'

Assembler is beyond my scope. Maybe a bug in Clang?

Attachments (2)

main.log (151.0 KB) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
main.log from build on PPC Tiger with patched pqg.c
pqg.c-ULL_addend.diff (451 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
Patch to correct type problem

Download all attachments as: .zip

Change History (4)

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

Attachment: main.log added

main.log from build on PPC Tiger with patched pqg.c

comment:1 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

The main.log file with the original type error is here: https://trac.macports.org/attachment/ticket/51196/main.3.log.

Version 0, edited 8 years ago by ballapete (Peter "Pete" Dyballa) (next)

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

Attachment: pqg.c-ULL_addend.diff added

Patch to correct type problem

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

Resolution: duplicate
Status: newclosed

Duplicate of #51543. If the problem remains with the latest version, please work with the developer to get it fixed.

Note: See TracTickets for help on using tickets.