Opened 4 years ago

Closed 3 years ago

#59675 closed defect (fixed)

babl @ 0.1.72: error: instruction requires: Not 64-bit mode

Reported by: kencu (Ken) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: babl

Description

meson and babl have some trouble sorting out what they are building for:

[16/184] Compiling C object 'babl/4170c83@@babl-0.1@sha/babl-cache.c.o'.
[17/184] Compiling C object 'babl/4170c83@@babl-0.1@sha/babl-core.c.o'.
[18/184] Compiling C object 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o'.
FAILED: babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o 
/opt/local/bin/clang-mp-9.0 -Ibabl/4170c83@@babl-0.1@sha -Ibabl -I../babl-0.1.72/babl -I. -I../babl-0.1.72/ -Ibabl/base -I../babl-0.1.72/babl/base -I/opt/local/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -g -Ofast -Wdeclaration-after-statement -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -mmmx -msse -mfpmath=sse -Os -arch x86_64 -msse2 '-DLIBDIR="/opt/local/lib"' -MD -MQ 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o' -MF 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o.d' -o 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o' -c ../babl-0.1.72/babl/babl-cpuaccel.c
../babl-0.1.72/babl/babl-cpuaccel.c:161:12: error: instruction requires: Not 64-bit mode
  __asm__ ("pushfl\n\t"
           ^
<inline asm>:1:2: note: instantiated into assembly here
        pushfl

I had to add the following two lines to the meson.build script to get it to build on SnowLeopard. Likely the same on similar hardware (10.7, etc).

if   host_cpu.startswith('i') and host_cpu.endswith('86')
  have_x86 = true
  conf.set10('ARCH_X86', true, description:
    'Define to 1 if you are compiling for ix86.')
+  conf.set10('ARCH_X86_64', true, description:
+    'Define to 1 if you are compiling for amd64.')
elif host_cpu == 'x86_64'
  have_x86 = true
  conf.set10('ARCH_X86', true, description:
    'Define to 1 if you are compiling for ix86.')
  conf.set10('ARCH_X86_64', true, description:
    'Define to 1 if you are compiling for amd64.')
elif host_cpu == 'ppc' or host_cpu == 'powerpc'

Change History (5)

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

Ken, I think I've mentioned to you in other tickets that this does not sound like the right solution. The proposed change would make the build fail on CPUs that are actually 32-bit. The problem probably results from the fact that meson is misidentifying your CPU as 32-bit because its kernel architecture is 32-bit, even though its user architecture is 64-bit. Meson needs to be fixed to identify this type of CPU correctly.

comment:2 Changed 4 years ago by kencu (Ken)

Agreed -- I'm not proposing this hack as the "MacPorts fix". Consider this a ticket with a workaround ...

I don't know what the proper fix for this will be, exactly, if there ever is one. I suspect one day I'll be the one who sorts out how to hack meson for MacPorts to fix this, to be honest.

But for now, for all those folks who will go looking for how to get past this while it gets sorted out (and for me, frankly, three or six months from now when I come across this error again with the next upgrade to babl), I put the temp fix here pending a proper, robust, and clean solution.

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

Instead of filing a ticket for each MacPorts port affected by this meson bug, it would be more useful to file one bug with the developers of meson so that they can fix the problem; I've done that here: https://github.com/mesonbuild/meson/issues/6187

comment:4 Changed 4 years ago by kencu (Ken)

The recent meson commit should fix this for most but not all systems. However, there is a different babl error as well, that is only fixed in babl-devel at present, that still breaks building 64bit on 32bit kernel machines. Not sure if it's worth backporting the babl-devel fix into this version of babl, or just waiting for the next babl release that presumably has the fix in it.

comment:5 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.