[pdftex] Compiling on M1 Mac

Jason Eveleth jason_eveleth at brown.edu
Mon Nov 14 05:52:32 CET 2022


Dear pdftex developers,

I'm trying to get pdftex to compile on M1 mac. For some reason it is
failing to compile some arm specific files for libpng. I found that if I
compiled it up to the point where the actual pdftex binary is produced
(which is a command like this [1] for me) and then swapped in a correctly
compiled libpng.a file, then the rest of it worked smoothly. So, the issue
is the compilation of libpng. Now, I've never used automake/autoconf
before, but I've tracked down the issue to whether I'm
using --enable-arm-neon=yes when the src/libs/libpng/configure is called. I
think that would get the arm specific files complied into the library.
Where is src/libs/libpng/configure called? Or what file generates the file
that calls that? Another possible way to go is to set PNG_ARM_NEON
somewhere in the call to configure. I got this idea here
<https://app.bountysource.com/issues/97456126-link-error-on-intel-macos-when-building-universal-binary-arm64-using-cmake>
.

The other alternative is to bump the version of libpng in the src
directory. I compiled the current version libpng just fine, but when I
tried to swap the code for it into the src/libs/libpng, I got an error for
"No rule to make target `rebuild'.  Stop." So, it seems like more tweaking
would be necessary to go that route. I've included the linker output [2] in
case that helps.

I've also included the output of `uname -a` and current OS version [3]. The
./build-pdftex.sh file selects the `make` (which is GNU Make). If there's
any other system information you'd like, let me know.

Best,
Jason

[1]:  "g++ -std=gnu++11 -Wreturn-type -Wno-write-strings -g -o pdftex
pdftexdir/pdftex-pdftexextra.o synctexdir/pdftex-synctex.o
pdftex-pdftexini.o pdftex-pdftex0.o pdftex-pdftex-pool.o -Wl,-bind_at_load
 libpdftex.a /Users/jason/src/pdflatex/build-pdftex/libs/libpng/libpng.a
/Users/jason/src/pdflatex/build-pdftex/libs/zlib/libz.a
/Users/jason/src/pdflatex/build-pdftex/libs/xpdf/libxpdf.a libmd5.a
lib/lib.a
/Users/jason/src/pdflatex/build-pdftex/texk/kpathsea/.libs/libkpathsea.a"

[2]:
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -std=gnu++11 -Wreturn-type
-Wno-write-strings -g   -o pdftex pdftexdir/pdftex-pdftexextra.o
synctexdir/pdftex-synctex.o pdftex-pdftexini.o pdftex-pdftex0.o
pdftex-pdftex-pool.o libpdftex.a
/Users/jason/src/pdflatex/build-pdftex/libs/libpng/libpng.a
/Users/jason/src/pdflatex/build-pdftex/libs/zlib/libz.a
/Users/jason/src/pdflatex/build-pdftex/libs/xpdf/libxpdf.a libmd5.a
lib/lib.a /Users/jason/src/pdflatex/build-pdftex/texk/kpathsea/
libkpathsea.la
libtool: link: g++ -std=gnu++11 -Wreturn-type -Wno-write-strings -g -o
pdftex pdftexdir/pdftex-pdftexextra.o synctexdir/pdftex-synctex.o
pdftex-pdftexini.o pdftex-pdftex0.o pdftex-pdftex-pool.o -Wl,-bind_at_load
 libpdftex.a /Users/jason/src/pdflatex/build-pdftex/libs/libpng/libpng.a
/Users/jason/src/pdflatex/build-pdftex/libs/zlib/libz.a
/Users/jason/src/pdflatex/build-pdftex/libs/xpdf/libxpdf.a libmd5.a
lib/lib.a
/Users/jason/src/pdflatex/build-pdftex/texk/kpathsea/.libs/libkpathsea.a
Undefined symbols for architecture arm64:
  "_png_do_expand_palette_rgb8_neon", referenced from:
      _png_do_expand_palette in libpng.a(pngrtran.o)
  "_png_do_expand_palette_rgba8_neon", referenced from:
      _png_do_expand_palette in libpng.a(pngrtran.o)
  "_png_init_filter_functions_neon", referenced from:
      _png_init_filter_functions in libpng.a(pngrutil.o)
  "_png_riffle_palette_neon", referenced from:
      _png_do_read_transformations in libpng.a(pngrtran.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make: *** [pdftex] Error 1

[3]:
Darwin ocean 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT
2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64
macOS Ventura 13.0 (22A380)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/pdftex/attachments/20221113/0b37f0c3/attachment.html>


More information about the pdftex mailing list.