Opened 16 months ago

Closed 9 months ago

#63062 closed defect (fixed)

cdrtools @3.01_1: build error Apple Silicon

Reported by: pinodim Owned by: markmentovai (Mark Mentovai)
Priority: Normal Milestone:
Component: ports Version:
Keywords: arm64 Cc: MaurizioLoreti, jrjsmrtn, Guymer (Thomas Guymer)
Port: cdrtools

Description (last modified by reneeotten (Renee Otten))

:info:build smake: Error 133. *** Code 133 from command line for target '../incs/arm64-darwin-clang/avoffset.h'.
:info:build smake: The following command caused the error:
:info:build echo "	==> GENERATING include file \"../incs/arm64-darwin-clang/avoffset.h\""; \
:info:build 		OBJ/arm64-darwin-clang/avoffset > ../incs/arm64-darwin-clang/avoffset.h || \
:info:build 		 OBJ/arm64-darwin-clang/avoffset > ../incs/arm64-darwin-clang/avoffset.h
:info:build smake: Couldn't make 'all'.
:info:build smake: Leaving  'smake'[2] from directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cdrtools/cdrtools/work/cdrtools-3.01/inc'
:info:build smake: Default commandline target: 'all'
:info:build smake: Doing                       exit(1)
:info:build smake: Operation not permitted. *** Code 1 from command line for target 'all'.
:info:build smake: The following command caused the error:
:info:build for MK in align_test.mk avoffset.mk ;					\
:info:build 	do								\
:info:build 		(							\
:info:build 		if [ -r ./$MK ] ; then					\
:info:build 			echo "	==> MAKING \"all\" ON SUBCOMPONENT \"SRCROOT/inc/$MK\""; "smake" -f $MK  XARCH=arm64-darwin-clang all;\
:info:build 		else							\
:info:build 			echo "NOTICE: Partial source (SRCROOT/inc/$MK) missing";\
:info:build 		fi							\
:info:build 		);							\
:info:build 	done
:info:build smake: Couldn't make 'all'.
:info:build smake: Leaving  'smake'[1] from directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cdrtools/cdrtools/work/cdrtools-3.01/inc'
:info:build smake: Default commandline target: 'all'
:info:build smake: Doing                       exit(1)
:info:build smake: Operation not permitted. *** Code 1 from command line for target 'all'.
:info:build smake: The following command caused the error:
:info:build list="";							\
:info:build 	if [ -d TARGETS -a -f TARGETS/__slot ]; then				\
:info:build 		list=`echo TARGETS/[0123456789][0123456789]* |			\
:info:build 			sed -e 's;TARGETS/[0123456789][0123456789];;g' | sed -e 's;!@!;/;g'`;\
:info:build 	fi;									\
:info:build 	for DIR in ${list} ;							\
:info:build 	do									\
:info:build 		(								\
:info:build 		echo "	==> MAKING \"all\" ON SUBDIRECTORY \"SRCROOT/$DIR\"";\
:info:build 		if [ -d ./$DIR -a -r ./$DIR/Makefile ] ; then			\
:info:build 			cd ./$DIR && "smake"  XARCH=arm64-darwin-clang DIRNAME=SRCROOT/$DIR all;		\
:info:build 		else								\
:info:build 			echo "NOTICE: Partial source (SRCROOT/$DIR) missing";\
:info:build 		fi								\
:info:build 		);								\
:info:build 	done
:info:build smake: Couldn't make 'all'.
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cdrtools/cdrtools/work/cdrtools-3.01" && smake all CC=/usr/bin/clang COPTX="-Os -Wno-error=implicit-function-declaration -arch arm64" DEFOSINCDIRS=/opt/local/include LDOPTX="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch arm64" LDPATH= 
:info:build Exit code: 1
:error:build Failed to build cdrtools: command execution failed
:debug:build Error code: CHILDSTATUS 13940 1
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cdrtools/cdrtools/main.log for details.

Attachments (1)

cdrtools1.log (69.1 KB) - added by pinodim 16 months ago.

Download all attachments as: .zip

Change History (10)

Changed 16 months ago by pinodim

Attachment: cdrtools1.log added

comment:1 Changed 16 months ago by reneeotten (Renee Otten)

Description: modified (diff)
Keywords: bigsur added; Big Sur removed

comment:2 Changed 16 months ago by ryandesign (Ryan Schmidt)

See also #61250.

comment:3 Changed 11 months ago by MaurizioLoreti

On M1 macbook pro, cdrtools does not build. The reason is a missing #endif in avoffset.h : the clause

#ifndef __AVOFFSET_H
#define __AVOFFSET_H

is not terminated.

comment:4 Changed 11 months ago by pinodim

Yes! Thanks Maurizio. 
(the file is located in **arm64-darwin-clang** directory)

comment:5 Changed 10 months ago by ryandesign (Ryan Schmidt)

Cc: MaurizioLoreti added
Keywords: bigsur removed
Summary: cdrtools 3.01_1 build error on macOS 11cdrtools @3.01_1: build error Apple Silicon

That file is generated by the cdrtools build system (by avoffset.c), obviously faultily on arm64. I don't know what a correctly generated file for arm64 would look like. Please report the bug to the developers of cdrtools so that they can correct it and release a new version of cdrtools. MacPorts can then update to the new version.

comment:6 Changed 10 months ago by jrjsmrtn

Cc: jrjsmrtn added

comment:7 Changed 9 months ago by Guymer (Thomas Guymer)

Cc: Guymer added

comment:8 Changed 9 months ago by markmentovai (Mark Mentovai)

comment:9 Changed 9 months ago by markmentovai (Mark Mentovai)

Owner: set to markmentovai
Resolution: fixed
Status: newclosed

In 656932616eebe60f4e8cfd96d8268801dad8224d/macports-ports (master):

cdrtools: fix arm64 build by explicitly disabling stack scanning

avoffset, a helper program run during the cdrtools build, was crashing
on arm64 when built with optimization, with EXC_BREAKPOINT (SIGTRAP),
triggered by a brk instruction inserted by the compiler in a code path
that was provably attempting to dereference a null pointer. Under the
same conditions on x86_64, the compiler inserted a ud2 instruction
resulting in EXC_BAD_INSTRUCTION (SIGILL). On either architecture, when
not under optimization, the null pointer dereference resulted in
EXC_BAD_ACCESS (SIGSEGV). avoffset has signal handlers for both SIGILL
and SIGSEGV, and recovered "gracefully" by configuring the build to
disable stack scanning and exiting cleanly. Without a SIGTRAP handler,
the avoffset crash results in a failed build on arm64 under
optimization.

It would be easy to add a SIGTRAP handler, but a more direct approach is
to explicitly disable stack scanning by defining NO_SCANSTACK during the
build. The stack scanning concept and implementation are both
ill-advised, and none of it was working on any architecture or any build
configuration on macOS anyway. Even with avoffset "working" (not
crashing), all it did on macOS was detect the failure and disable stack
scanning for the rest of the build.

Closes: #63062

Note: See TracTickets for help on using tickets.