Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#62026 closed defect (fixed)

lz4 @1.9.3: does not build universal with arm64/x86_64 on an Intel system ./gen_manual: Bad CPU type in executable

Reported by: kencu (Ken) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: lz4

Description (last modified by kencu (Ken))

it may not build arm64 at all, but this is a universal build on a BigSur Intel system:

/usr/bin/clang++  -Os -stdlib=libc++ -arch arm64  gen_manual.cpp -o gen_manual
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_lz4/lz4/work/lz4-1.9.3-arm64/tests'
/usr/bin/clang -c -Os -arch arm64 -I../lib -I../programs -DXXH_NAMESPACE=LZ4_ ../lib/lz4.c -o lz4.o
/usr/bin/clang -c -Os -arch arm64 -I../lib -I../programs -DXXH_NAMESPACE=LZ4_ ../lib/lz4hc.c -o lz4hc.o
/usr/bin/clang -c -Os -arch arm64 -I../lib -I../programs -DXXH_NAMESPACE=LZ4_ ../lib/lz4frame.c -o lz4frame.o
/usr/bin/clang -c -Os -arch arm64 -I../lib -I../programs -DXXH_NAMESPACE=LZ4_ ../lib/xxhash.c -o xxhash.o
/usr/bin/clang -Os -arch arm64 -I../lib -I../programs -DXXH_NAMESPACE=LZ4_  -I../programs ../programs/datagen.c datagencli.c -o datagen
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_lz4/lz4/work/lz4-1.9.3-arm64/lib'
compiling static library
echo "Update lz4 manual in /doc"
echo "Update lz4frame manual in /doc"
Update lz4frame manual in /doc
Update lz4 manual in /doc
./gen_manual 1.9.3 ../../lib/lz4frame.h ../../doc/lz4frame_manual.html
make[1]: ./gen_manual: Bad CPU type in executable
./gen_manual 1.9.3 ../../lib/lz4.h ../../doc/lz4_manual.html
make[1]: ./gen_manual: Bad CPU type in executable
make[1]: *** [../../doc/lz4frame_manual.html] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [../../doc/lz4_manual.html] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_archivers_lz4/lz4/work/lz4-1.9.3-arm64/contrib/gen_manual'

Attachments (1)

lz4-universal-fail.log (15.1 KB) - added by kencu (Ken) 3 years ago.

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by kencu (Ken)

Attachment: lz4-universal-fail.log added

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

hmmm. that's interesting. It does build arm64, it seems:

<http://packages.macports.org/lz4/lz4-1.9.3_0.darwin_20.arm64.tbz2>

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

Description: modified (diff)

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

during the build, it generates a file in the architecture being built to build the manual I guess:

% file ./lz4-1.9.3-arm64/contrib/gen_manual/gen_manual
./lz4-1.9.3-arm64/contrib/gen_manual/gen_manual: Mach-O 64-bit executable arm64

Intel systems can build this arm64 executable, but they can't run it, ergo the failure.

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

one fix is to turn off the generation of the manual by using build.target allmost:

% port -v installed lz4
The following ports are currently installed:
  lz4 @1.9.3_0+universal (active) platform='darwin 20' archs='arm64 x86_64' date='2021-01-10T13:13:03-0800'

No doubt Ryan has a better idea.

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

Summary: lz4 @1.9.3: does not build universal with arm64/x86_64 ./gen_manual: Bad CPU type in executablelz4 @1.9.3: does not build universal with arm64/x86_64 on an Intel system ./gen_manual: Bad CPU type in executable

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

Resolution: fixed
Status: assignedclosed

In e14644e9ef326aa65c963adce832cdb6f4691715/macports-ports (master):

lz4: Remove -arch flags when building gen_manual

Closes: #62026

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

that was an elegant fix I never would have thought of. Thanks!

Note: See TracTickets for help on using tickets.