[MacPorts] #60147: legacy-support: unable to build on Leopard PPC

MacPorts noreply at macports.org
Sat Feb 29 19:23:36 UTC 2020


#60147: legacy-support: unable to build on Leopard PPC
-----------------------------+----------------------
  Reporter:  kencu           |      Owner:  kencu
      Type:  defect          |     Status:  assigned
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:
Resolution:                  |   Keywords:
      Port:  legacy-support  |
-----------------------------+----------------------
Description changed by kencu:

Old description:

> at present, I am not sure exactly what to do to fix this issue.
>
> The makefile now hard-codes in {{{-arch}}} flags, and these may not be
> supported by all the compilers we expect to use (we may have to hack out
> some compilers then, the ones that don't support (multiple?) arch flags).
>
> I assume that something is calling in the same {{{arch}}} multiple times
> to generate this error. I am a bit out of my depth in this level of
> Makefile... maybe we have to somehow hack in a "FORCE_ARCH" setting?
>
> At any rate, at present
>
> {{{
> $ make
> cc -c -Iinclude -Os -Wall test/test_arc4random.c -o
> test/test_arc4random.o
> cc -c -Iinclude -Os -Wall -fPIC src/arc4random.c -o src/arc4random.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/atcalls.c -o src/atcalls.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/best_fchdir.c -o src/best_fchdir.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/getdelim.c -o src/getdelim.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/getline.c -o src/getline.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/lchmod.c -o src/lchmod.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/macports_legacy_realpath.c -o
> src/macports_legacy_realpath.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/macports_legacy_sysconf.c -o
> src/macports_legacy_sysconf.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/memmem.c -o src/memmem.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/posix_memalign_emulation.c -o
> src/posix_memalign_emulation.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/sincos.c -o src/sincos.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/strndup.c -o src/strndup.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/strnlen.c -o src/strnlen.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/time.c -o src/time.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/wcpcpy_family.c -o
> src/wcpcpy_family.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/wcscasecmp_family.c -o
> src/wcscasecmp_family.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/wcsdup.c -o src/wcsdup.dl.o
> cc -c -Iinclude -Os -Wall -fPIC src/wcsnlen.c -o src/wcsnlen.dl.o
> # Generate possibly multi-architecture object files ...
> cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=0
> -D__DARWIN_64_BIT_INO_T=0 -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c
> -o src/fdopendir.dl.o.inode32
> cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
> -D__DARWIN_ONLY_UNIX_CONFORMANCE=0 -D__DARWIN_64_BIT_INO_T=0
> -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
> src/fdopendir.dl.o.inode32unix2003
> cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
> -D__DARWIN_ONLY_UNIX_CONFORMANCE=1 -D__DARWIN_64_BIT_INO_T=1
> -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
> src/fdopendir.dl.o.inode64
> cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
> -D__DARWIN_ONLY_UNIX_CONFORMANCE=0 -D__DARWIN_64_BIT_INO_T=1
> -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
> src/fdopendir.dl.o.inode64unix2003
> # ... and split them up, because ld can only generate single-architecture
> files ...
> output='src/fdopendir.dl.o' && lipo='lipo' && rm='rm -f' && cp='/bin/cp'
> && ld='ld' && grep='/usr/bin/grep' && platform='9' && force_arch='' &&
> objectlist="${output}".* && archlist='' && fatness='' && for object in
> ${objectlist}; do if [ -z "${force_arch}" ]; then archlist_new="$(${lipo}
> -archs "${object}")"; else archlist_new="${force_arch}"; fi && if [ -n
> "${archlist}" ] && [ "${archlist}" != "${archlist_new}" ]; then printf
> 'Old/previous architecture list "%s" does not match new one "%s", this is
> unsupported.\n' "${archlist}" "${archlist_new}" >&2 && exit '1'; else
> archlist="${archlist_new}"; fi && ( ${lipo} -info "${object}" | grep -qs
> '^Non-fat file:' ); fatness_new="${?}" && if [ -n "${fatness}" ] && [
> "${fatness}" != "${fatness_new}" ]; then printf 'Old/previous fatness
> value "%d" does not match new one "%d", this is unsupported.\n'
> "${fatness}" "${fatness_new}" >&2 && exit '2'; else
> fatness="${fatness_new}"; fi && if [ -n "${force_arch}" ] && [ '0' -ne
> "${fatness}" ]; then printf 'Architecture forced to "%s", but object file
> "%s" is a multi-architecture (fat) object file, this is unsupported.\n'
> "${force_arch}" "${object}" >&2 && exit '3'; fi && $(: 'Check for unknown
> architectures.') && for arch in ${archlist}; do case "${arch}" in
> (unknown*) printf 'Unknown architecture "%s" encountered, this is
> unsupported.\n' "${arch}" >&2 && exit '4'; ;; (*) ;; esac && if [ '0' -eq
> "${fatness}" ]; then ${cp} "${object}" "${object}.${arch}" && $(: 'A non-
> fat file cannot have more than one architecture, but breaking out sounds
> weird.'); else ${lipo} "${object}" -thin "${arch}" -output
> "${object}.${arch}"; fi; done && ${rm} "${object}"; done && $(: '... and
> use ld to merge each variant into a single-architecture object file ...')
> && for arch in ${archlist}; do $(: 'Filter out variants not applicable to
> certain architectures.') && $(: 'For instance, the x86_64 architecture is
> fully UNIX2003-compliant and thus does not have $UNIX2003-compat
> functons.') && $(: 'On the contrary, the i386 architecture has only
> $UNIX2003-compat functions for the $INODE64 feature set.') && $(: '10.4
> is so old that it does not even have the $INODE64 feature.') && case
> "${arch}" in ('x86_64') ${ld} -r "${output}.inode32.${arch}"
> "${output}.inode64.${arch}" -o "${output}.${arch}"; ;; ('ppc64') if [ '9'
> -gt "${platform}" ]; then ${ld} -r "${output}.inode32.${arch}" -o
> "${output}.${arch}"; else ${ld} -r "${output}.inode32.${arch}"
> "${output}.inode64.${arch}" -o "${output}.${arch}"; fi; ;; ('i386'|'ppc')
> if [ '9' -gt "${platform}" ]; then ${ld} -r "${output}.inode32.${arch}"
> "${output}.inode32unix2003.${arch}" -o "${output}.${arch}"; else ${ld} -r
> "${output}.inode32.${arch}" "${output}.inode32unix2003.${arch}"
> "${output}.inode64unix2003.${arch}" -o "${output}.${arch}"; fi; ;; (*)
> ${ld} -r "${output}.inode32.${arch}" "${output}.inode32unix2003.${arch}"
> "${output}.inode64.${arch}" "${output}.inode64unix2003.${arch}" -o
> "${output}.${arch}"; ;; esac; done && $(: '... build list of single-
> architecture merged object files ...') && objectarchlist='' && for arch
> in ${archlist}; do objectarchlist="${objectarchlist} ${output}.${arch}";
> done && if [ '0' -eq "${fatness}" ]; then $(: 'Thin files can just be
> copied directly, assuming that the list will only contain one element.')
> && ${cp} ${objectarchlist} "${output}"; else $(: '... and eventually use
> lipo to merge them all together!') && ${lipo} ${objectarchlist} -create
> -output "${output}"; fi
> ld: duplicate symbol _fdopendir$INODE64$UNIX2003 in
> src/fdopendir.dl.o.inode64unix2003.ppc7400 and
> src/fdopendir.dl.o.inode64.ppc7400 for inferred architecture ppc7400
> make: *** [src/fdopendir.dl.o] Error 1
> }}}

New description:

 This is building the software directly from the checkout of the git repo.

 At present, I am not sure exactly what to do to fix this issue.

 The makefile now hard-codes in {{{-arch}}} flags, and these may not be
 supported by all the compilers we expect to use (we may have to hack out
 some compilers then, the ones that don't support (multiple?) arch flags).

 I assume that something is calling in the same {{{arch}}} multiple times
 to generate this error. I am a bit out of my depth in this level of
 Makefile... maybe we have to somehow hack in a "FORCE_ARCH" setting?

 At any rate, at present

 {{{
 $ make
 cc -c -Iinclude -Os -Wall test/test_arc4random.c -o test/test_arc4random.o
 cc -c -Iinclude -Os -Wall -fPIC src/arc4random.c -o src/arc4random.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/atcalls.c -o src/atcalls.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/best_fchdir.c -o src/best_fchdir.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/getdelim.c -o src/getdelim.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/getline.c -o src/getline.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/lchmod.c -o src/lchmod.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/macports_legacy_realpath.c -o
 src/macports_legacy_realpath.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/macports_legacy_sysconf.c -o
 src/macports_legacy_sysconf.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/memmem.c -o src/memmem.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/posix_memalign_emulation.c -o
 src/posix_memalign_emulation.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/sincos.c -o src/sincos.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/strndup.c -o src/strndup.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/strnlen.c -o src/strnlen.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/time.c -o src/time.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/wcpcpy_family.c -o
 src/wcpcpy_family.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/wcscasecmp_family.c -o
 src/wcscasecmp_family.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/wcsdup.c -o src/wcsdup.dl.o
 cc -c -Iinclude -Os -Wall -fPIC src/wcsnlen.c -o src/wcsnlen.dl.o
 # Generate possibly multi-architecture object files ...
 cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=0
 -D__DARWIN_64_BIT_INO_T=0 -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c
 -o src/fdopendir.dl.o.inode32
 cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
 -D__DARWIN_ONLY_UNIX_CONFORMANCE=0 -D__DARWIN_64_BIT_INO_T=0
 -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
 src/fdopendir.dl.o.inode32unix2003
 cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
 -D__DARWIN_ONLY_UNIX_CONFORMANCE=1 -D__DARWIN_64_BIT_INO_T=1
 -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
 src/fdopendir.dl.o.inode64
 cc -c -Iinclude -Os -Wall -fPIC -D__DARWIN_UNIX03=1
 -D__DARWIN_ONLY_UNIX_CONFORMANCE=0 -D__DARWIN_64_BIT_INO_T=1
 -D__DARWIN_ONLY_64_BIT_INO_T=0 src/fdopendir.c -o
 src/fdopendir.dl.o.inode64unix2003
 # ... and split them up, because ld can only generate single-architecture
 files ...
 output='src/fdopendir.dl.o' && lipo='lipo' && rm='rm -f' && cp='/bin/cp'
 && ld='ld' && grep='/usr/bin/grep' && platform='9' && force_arch='' &&
 objectlist="${output}".* && archlist='' && fatness='' && for object in
 ${objectlist}; do if [ -z "${force_arch}" ]; then archlist_new="$(${lipo}
 -archs "${object}")"; else archlist_new="${force_arch}"; fi && if [ -n
 "${archlist}" ] && [ "${archlist}" != "${archlist_new}" ]; then printf
 'Old/previous architecture list "%s" does not match new one "%s", this is
 unsupported.\n' "${archlist}" "${archlist_new}" >&2 && exit '1'; else
 archlist="${archlist_new}"; fi && ( ${lipo} -info "${object}" | grep -qs
 '^Non-fat file:' ); fatness_new="${?}" && if [ -n "${fatness}" ] && [
 "${fatness}" != "${fatness_new}" ]; then printf 'Old/previous fatness
 value "%d" does not match new one "%d", this is unsupported.\n'
 "${fatness}" "${fatness_new}" >&2 && exit '2'; else
 fatness="${fatness_new}"; fi && if [ -n "${force_arch}" ] && [ '0' -ne
 "${fatness}" ]; then printf 'Architecture forced to "%s", but object file
 "%s" is a multi-architecture (fat) object file, this is unsupported.\n'
 "${force_arch}" "${object}" >&2 && exit '3'; fi && $(: 'Check for unknown
 architectures.') && for arch in ${archlist}; do case "${arch}" in
 (unknown*) printf 'Unknown architecture "%s" encountered, this is
 unsupported.\n' "${arch}" >&2 && exit '4'; ;; (*) ;; esac && if [ '0' -eq
 "${fatness}" ]; then ${cp} "${object}" "${object}.${arch}" && $(: 'A non-
 fat file cannot have more than one architecture, but breaking out sounds
 weird.'); else ${lipo} "${object}" -thin "${arch}" -output
 "${object}.${arch}"; fi; done && ${rm} "${object}"; done && $(: '... and
 use ld to merge each variant into a single-architecture object file ...')
 && for arch in ${archlist}; do $(: 'Filter out variants not applicable to
 certain architectures.') && $(: 'For instance, the x86_64 architecture is
 fully UNIX2003-compliant and thus does not have $UNIX2003-compat
 functons.') && $(: 'On the contrary, the i386 architecture has only
 $UNIX2003-compat functions for the $INODE64 feature set.') && $(: '10.4 is
 so old that it does not even have the $INODE64 feature.') && case
 "${arch}" in ('x86_64') ${ld} -r "${output}.inode32.${arch}"
 "${output}.inode64.${arch}" -o "${output}.${arch}"; ;; ('ppc64') if [ '9'
 -gt "${platform}" ]; then ${ld} -r "${output}.inode32.${arch}" -o
 "${output}.${arch}"; else ${ld} -r "${output}.inode32.${arch}"
 "${output}.inode64.${arch}" -o "${output}.${arch}"; fi; ;; ('i386'|'ppc')
 if [ '9' -gt "${platform}" ]; then ${ld} -r "${output}.inode32.${arch}"
 "${output}.inode32unix2003.${arch}" -o "${output}.${arch}"; else ${ld} -r
 "${output}.inode32.${arch}" "${output}.inode32unix2003.${arch}"
 "${output}.inode64unix2003.${arch}" -o "${output}.${arch}"; fi; ;; (*)
 ${ld} -r "${output}.inode32.${arch}" "${output}.inode32unix2003.${arch}"
 "${output}.inode64.${arch}" "${output}.inode64unix2003.${arch}" -o
 "${output}.${arch}"; ;; esac; done && $(: '... build list of single-
 architecture merged object files ...') && objectarchlist='' && for arch in
 ${archlist}; do objectarchlist="${objectarchlist} ${output}.${arch}"; done
 && if [ '0' -eq "${fatness}" ]; then $(: 'Thin files can just be copied
 directly, assuming that the list will only contain one element.') && ${cp}
 ${objectarchlist} "${output}"; else $(: '... and eventually use lipo to
 merge them all together!') && ${lipo} ${objectarchlist} -create -output
 "${output}"; fi
 ld: duplicate symbol _fdopendir$INODE64$UNIX2003 in
 src/fdopendir.dl.o.inode64unix2003.ppc7400 and
 src/fdopendir.dl.o.inode64.ppc7400 for inferred architecture ppc7400
 make: *** [src/fdopendir.dl.o] Error 1
 }}}

--

-- 
Ticket URL: <https://trac.macports.org/ticket/60147#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list