Opened 2 years ago

Last modified 8 months ago

#64487 reopened defect

m4 fails to build for ppc on 10.6.8 (Rosetta) – solution found

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: powerpc Cc:
Port: m4

Description

depbase=`echo setlocale_null.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	/usr/bin/gcc-4.2 -std=gnu99  -I.   -I/opt/powerpc/include  -pipe -Os -arch ppc -MT setlocale_null.o -MD -MP -MF $depbase.Tpo -c -o setlocale_null.o setlocale_null.c &&\
	mv -f $depbase.Tpo $depbase.Po
{standard input}:18:Invalid mnemonic 'fnstcw'
{standard input}:24:Invalid mnemonic 'fldcw'
{standard input}:240:Invalid mnemonic 'fldcw'
depbase=`echo sig-handler.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	/usr/bin/gcc-4.2 -std=gnu99  -I.   -I/opt/powerpc/include  -pipe -Os -arch ppc -MT sig-handler.o -MD -MP -MF $depbase.Tpo -c -o sig-handler.o sig-handler.c &&\
	mv -f $depbase.Tpo $depbase.Po
make[3]: *** [printf-frexpl.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/opt/powerpc/var/macports/build/_opt_powerpc_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/powerpc/var/macports/build/_opt_powerpc_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/powerpc/var/macports/build/_opt_powerpc_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19'
make: *** [all] Error 2
make: Leaving directory `/opt/powerpc/var/macports/build/_opt_powerpc_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19'
Command failed:  cd "/opt/powerpc/var/macports/build/_opt_powerpc_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_m4/m4/work/m4-1.4.19" && /usr/bin/make -j8 -w all 
Exit code: 2
Error: Failed to build m4: command execution failed

Attachments (3)

main.log (195.1 KB) - added by barracuda156 2 years ago.
10.6.8_Xcode3.2_m4_ppc.log (172.3 KB) - added by barracuda156 2 years ago.
config_10.6.8.log (1.5 MB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (12)

Changed 2 years ago by barracuda156

Attachment: main.log added

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

It's trying to use Intel assembly code even though you're trying to build for PowerPC. Find out why it's trying to do that and how to tell it to use PowerPC assembly (or no assembly) instead.

comment:2 in reply to:  1 ; Changed 2 years ago by barracuda156

Replying to ryandesign:

It's trying to use Intel assembly code even though you're trying to build for PowerPC. Find out why it's trying to do that and how to tell it to use PowerPC assembly (or no assembly) instead.

There must be some Macports .tcl file somewhere which handles build-host-target, linker and assembler assignment, I will try to find it.

(One reason some ports might try using i686 code is if they have a wrong setting for Xcode 4.x as if it cannot support PPC. I am quite sure I had zero problems with all these basic ports when building on 10.6 PPC. On 10.6.8 with Rosetta it turned to be harder, so far.)

comment:3 in reply to:  2 ; Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

There must be some Macports .tcl file somewhere which handles build-host-target, linker and assembler assignment, I will try to find it.

Not that I recall. Apple's position is that it is a mistake for build systems to rely on build-host-target, but many developers on non-Apple platforms haven't gotten that memo.

comment:4 in reply to:  3 Changed 2 years ago by barracuda156

Replying to ryandesign:

Replying to barracuda156:

There must be some Macports .tcl file somewhere which handles build-host-target, linker and assembler assignment, I will try to find it.

Not that I recall. Apple's position is that it is a mistake for build systems to rely on build-host-target, but many developers on non-Apple platforms haven't gotten that memo.

I have now removed Xcode 4.2 and Xcode 3.2.6 with their Unix tools, installed Xcode 3.2 onto 10.6.8, built Macports as ppc in default prefix to mimic conditions where m4 successfully builds on 10.6 PPC, however it still fails on 10.6.8.

I have a pre-built source for ppc now (built with identical Xcode tools and same version of gcc as in 10.6.8). Can I somehow install it into Macports on 10.6.8? (I know about setting up local archives way, but that is a fallback option if everything fails locally.)

Changed 2 years ago by barracuda156

Attachment: 10.6.8_Xcode3.2_m4_ppc.log added

Changed 2 years ago by barracuda156

Attachment: config_10.6.8.log added

comment:5 in reply to:  3 Changed 2 years ago by barracuda156

Replying to ryandesign:

I do not yet confirm it works, but I was able to build m4 with a similar addition to port file: https://trac.macports.org/ticket/64485

Sergey-Fedorovs-Mac-mini:~ svacchanda$ port -v installed m4
The following ports are currently installed:
  m4 @1.4.19_1 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-01-23T08:07:03+0800'

comment:6 Changed 2 years ago by barracuda156

Summary: m4 fails to build for ppc on 10.6.8 (Rosetta)m4 fails to build for ppc on 10.6.8 (Rosetta) – solution found

comment:7 Changed 20 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In 6958029c547b8102733b22f45de9f0ddda26348f/macports-ports (master):

m4: fix build on Rosetta
Fixes: #64487

comment:8 Changed 8 months ago by kencu (Ken)

Resolution: fixed
Status: closedreopened

This fix is not robust, and is too specific to 10.6

The same issue happens on other systems, such as the parallel of darwin9 building for ppc on an Intel system, which I am doing right now.

In fact, the issue will likely crop up any time the requested build does not match the output of config.guess.

A more robust fix might be to add the build parameter to all builds, or at least all builds where the requested build does not match config.guess.

Last edited 8 months ago by kencu (Ken) (previous) (diff)

comment:9 Changed 8 months ago by kencu (Ken)

one of the older llvm ports does this:

platform darwin {
    if {${build_arch} eq "i386"} {
        configure.pre_args-append --build=i686-apple-darwin${os.major}
    } elseif {${build_arch} eq "ppc"} {
        configure.pre_args-append --build=powerpc-apple-darwin${os.major}
    } elseif {${build_arch} eq "ppc64"} {
        configure.pre_args-append --build=powerpc64-apple-darwin${os.major}
    } else {
        configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
    }
}

perhaps something along those lines is needed for a robust fix for these issues, although branching I think on configure.build_arch instead of build_arch.

Have to see what the arm Macs want exactly, and they might need a specific addition as well.

Note: See TracTickets for help on using tickets.