Opened 3 years ago

Closed 2 years ago

#64497 closed defect (fixed)

grep fails to build for ppc on 10.6.8 (Rosetta)

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: powerpc, snowleopard, rosetta Cc:
Port: grep

Description

sigsegv.c: In function 'sigsegv_handler':
sigsegv.c:940: error: 'struct __darwin_ppc_thread_state' has no member named '__esp'
make[3]: *** [sigsegv.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /usr/include/libkern/OSByteOrder.h:43,
                 from /usr/include/mach/ndr.h:106,
                 from /usr/include/mach/clock_priv.h:7,
                 from /usr/include/mach/mach_interface.h:42,
                 from /usr/include/mach/mach.h:67,
                 from stackvma.c:1363:
/usr/include/libkern/ppc/OSByteOrder.h:155: error: redefinition of '_OSSwapInt16'
/usr/include/libkern/i386/_OSByteOrder.h:49: error: previous definition of '_OSSwapInt16' was here
/usr/include/libkern/ppc/OSByteOrder.h:164: error: redefinition of '_OSSwapInt32'
/usr/include/libkern/i386/_OSByteOrder.h:58: error: previous definition of '_OSSwapInt32' was here
/usr/include/libkern/ppc/OSByteOrder.h:173: error: redefinition of '_OSSwapInt64'
/usr/include/libkern/i386/_OSByteOrder.h:69: error: previous definition of '_OSSwapInt64' was here
make[3]: *** [stackvma.o] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_grep/grep/work/grep-3.7/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_grep/grep/work/grep-3.7/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_grep/grep/work/grep-3.7'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_grep/grep/work/grep-3.7'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_grep/grep/work/grep-3.7" && /usr/bin/make -j8 -w all 
Exit code: 2
Error: Failed to build grep: command execution failed

I have seen similar errors today earlier with m4.

Attachments (1)

main.log (143.0 KB) - added by barracuda156 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by barracuda156

Attachment: main.log added

comment:1 Changed 3 years ago by barracuda156

Keywords: snowleopard rosetta added

comment:2 Changed 3 years ago by barracuda156

Fixed with:

configure.args-append       CC_FOR_BUILD="gcc-4.2" \
                            CXX_FOR_BUILD="g++-4.2" \
                            CFLAGS_FOR_BUILD="-arch ppc -m32" \
                            CXXFLAGS_FOR_BUILD="-arch ppc -m32" \
                            --build=powerpc-apple-darwin10 \
                            --host=powerpc-apple-darwin10 \
                            --target=powerpc-apple-darwin10 \
                            --with-ld=/usr/bin/ld \
                            --with-as=/usr/bin/as
Sergey-Fedorovs-Mac-mini:~ svacchanda$ port -v installed grep
The following ports are currently installed:
  grep @3.7_2 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-01-26T15:32:13+0800'

comment:3 Changed 2 years ago by barracuda156

In fact this is sufficient:

# Fix for Rosetta: https://trac.macports.org/ticket/64497
platform darwin 10 {
    if {${build_arch} eq "ppc"} {
        configure.args-append \
                --build=powerpc-apple-darwin10
    }
}

comment:4 Changed 2 years ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In 97394293044d15e1813f85eb45f396d07c65f5cf/macports-ports (master):

grep: fix build on Rosetta
Fixes: #64497

Note: See TracTickets for help on using tickets.