Opened 3 years ago

Last modified 15 months ago

#62895 new defect

rasmol @2.7.4.2: error: no such file or directory: 'DarwinMachineDefines'

Reported by: richard-evans (Dr. Richard Evans) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: arm64 Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: rasmol, xorg-cf-files

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hi rasmol fails to build on M1/bigsur with the following error:

MOLDIR=\"/opt/local/share/rasmol/\" -DTHIRTYTWOBIT            -D_USE_RASMOL_H_     -c -o repres.o repres.c
:info:build clang: clang: clang: clangclang: : error: no such file or directory: 'DarwinMachineDefines'

It seems like an old definition that was recently removed in macOS, but I can't find any reference to it in the source code and google is unhelpful. Removing the definition "DarwinMachineDefines" in the makefile seems to fix it (it installs OK after that and runs fine) but not sure the best way to patch the port (bit of a port newbie) and whether removing this is in general safe.

Any thoughts?

Many thanks,

Richard

Change History (4)

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

Description: modified (diff)
Keywords: arm64 added
Summary: rasmol fails to build on BigSurrasmol @2.7.4.2: error: no such file or directory: 'DarwinMachineDefines'

Normally you should submit a main.log file when you encounter a build failure. But I tried a build on our Apple Silicon build machine and got the same problem, so that log is sufficient:

https://build.macports.org/builders/ports-11_arm64-builder/builds/20536/steps/install-port/logs/stdio

Something is supposed to be defining DarwinMachineDefines to the set of flags that are appropriate for your system. That "something" was probably written before Apple Silicon machines existed, so it doesn't define DarwinMachineDefines to anything on your system, so the literal string DarwinMachineDefines gets inserted instead, which is wrong.

I haven't yet found what is (supposed to be) defining DarwinMachineDefines in this case. I did find it for example here:

https://cgit.freedesktop.org/xorg/util/cf/tree/darwin.cf

And I found a previous reference to this kind of problem in #22528 (which was on Snow Leopard which was when Apple's gcc started defaulting to 64-bit compiles, so at that time it was probably the x86_64 architecture that wasn't being handled in the code.)

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

Cc: MarcusCalhoun-Lopez added
Port: xorg-cf-files added

Ok, here it is: it's xorg-cf-files:

$ port contents rdepof:rasmol | xargs grep DarwinMachineDefines 2>/dev/null
/opt/local/lib/X11/config/darwin.cf:# define DarwinMachineDefines   -D__powerpc__
/opt/local/lib/X11/config/darwin.cf:# define DarwinMachineDefines   -D__i386__
/opt/local/lib/X11/config/darwin.cf:# define DarwinMachineDefines   -D__x86_64__
/opt/local/lib/X11/config/darwin.cf:#define StandardDefines         DarwinMachineDefines -D__DARWIN__ \
$ port provides /opt/local/lib/X11/config/darwin.cf
/opt/local/lib/X11/config/darwin.cf is provided by: xorg-cf-files

Support for arm64 needs to be added to xorg-cf-files.

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

Possibly as simple as this:

  • Imake.cf

    old new  
    3737#  define x86_64DarwinArchitecture
    3838#  undef __x86_64__
    3939# endif
     40# ifdef __arm64__
     41#  define arm64DarwinArchitecture
     42#  undef __arm64__
     43# endif
    4044#endif
    4145
    4246#if defined(clipper) || defined(__clipper__)
  • darwin.cf

    old new  
    249249# define ByteOrder              X_LITTLE_ENDIAN
    250250#endif /* x86_64DarwinArchitecture */
    251251
     252#ifdef arm64DarwinArchitecture
     253# define DarwinMachineDefines   -D__arm64__
     254# if HasGcc3
     255#  define OptimizedCDebugFlags  -Os
     256# else
     257#  define OptimizedCDebugFlags  -O2 -fno-strength-reduce
     258# endif
     259# define ByteOrder              X_LITTLE_ENDIAN
     260#endif /* arm64DarwinArchitecture */
     261
    252262#if OSMajorVersion < 7
    253263# define DarwinLocaleDefines    -DX_LOCALE
    254264#else

comment:4 Changed 15 months ago by richard-evans (Dr. Richard Evans)

Sorry for continuing this ancient ticket! The problem still exists on Ventura, but I'm not sure how to regenerate the relevant file from xorg - is this run as part of the xorg installation? As I mentioned, removing the DarwinMachineDefines from the makefile fixes the bug for rasmol at least.

Note: See TracTickets for help on using tickets.