<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear pdftex developers,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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 <a href="https://app.bountysource.com/issues/97456126-link-error-on-intel-macos-when-building-universal-binary-arm64-using-cmake">here</a>.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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.</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><br class="gmail-Apple-interchange-newline">Best,</div><div class="gmail_default">Jason</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[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"</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[2]:</div><div class="gmail_default" style="font-size:small">/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/<a href="http://libkpathsea.la">libkpathsea.la</a>  <br>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<br>Undefined symbols for architecture arm64:<br>  "_png_do_expand_palette_rgb8_neon", referenced from:<br>      _png_do_expand_palette in libpng.a(pngrtran.o)<br>  "_png_do_expand_palette_rgba8_neon", referenced from:<br>      _png_do_expand_palette in libpng.a(pngrtran.o)<br>  "_png_init_filter_functions_neon", referenced from:<br>      _png_init_filter_functions in libpng.a(pngrutil.o)<br>  "_png_riffle_palette_neon", referenced from:<br>      _png_do_read_transformations in libpng.a(pngrtran.o)<br>ld: symbol(s) not found for architecture arm64<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>make: *** [pdftex] Error 1</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[3]:</div><div class="gmail_default" style="font-size:small">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<br></div><div class="gmail_default" style="font-size:small">macOS Ventura 13.0 (22A380)<br></div></div>