Opened 4 years ago

Closed 3 years ago

#62108 closed defect (fixed)

pdfgrep: error: no matching function for call to 'scandir'

Reported by: RobK88 Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: lion haspatch Cc:
Port: pdfgrep

Description

I am unable to build pdfgrep on Lion. Attached is the main.log

bash-3.2$ sudo port clean pdfgrep
--->  Cleaning pdfgrep
bash-3.2$ sudo port -v install pdfgrep
--->  Computing dependencies for pdfgrep.
--->  Fetching distfiles for pdfgrep
--->  Verifying checksums for pdfgrep
--->  Checksumming pdfgrep-2.1.1.tar.gz
--->  Extracting pdfgrep
--->  Extracting pdfgrep-2.1.1.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/pdfgrep/pdfgrep-2.1.1.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Configuring pdfgrep
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1" && ./configure --prefix=/opt/local --without-unac 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /opt/local/bin/clang++-mp-9.0 accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of /opt/local/bin/clang++-mp-9.0... gcc3
checking for gcc... /opt/local/bin/clang-mp-9.0
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/clang-mp-9.0 accepts -g... yes
checking for /opt/local/bin/clang-mp-9.0 option to accept ISO C89... none needed
checking whether /opt/local/bin/clang-mp-9.0 understands -c and -o together... yes
checking dependency style of /opt/local/bin/clang-mp-9.0... gcc3
checking whether /opt/local/bin/clang++-mp-9.0 supports C++11 features by default... yes
checking how to run the C preprocessor... /opt/local/bin/clang-mp-9.0 -E
checking for grep that handles long lines and -e... /opt/local/bin/ggrep
checking for egrep... /opt/local/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for regcomp... yes
checking for getopt_long... yes
checking for strcasestr... yes
checking for git head... 
checking for pkg-config m4 macros... yes
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for poppler-cpp... yes
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking for libgcrypt-config... /opt/local/bin/libgcrypt-config
checking for LIBGCRYPT - version >= 1.0.0... yes (1.9.0)
checking for libpcre... yes
checking zsh completion... ${datarootdir}/zsh/site-functions
checking bash completion... ${datarootdir}/bash-completion/completions
checking for a2x... no

* I didn't find Asciidoc, so you won't be able to (re)build the manpage.
* That's not a problem, if you're building from a release-tarball, because
* they include a prebuild manpage. But if you build from git, you should
* install Asciidoc or disable manpage generation with:
* ./configure --disable-doc
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating completion/Makefile
config.status: creating doc/Makefile
config.status: creating testsuite/Makefile
config.status: creating testsuite/config/Makefile
config.status: creating testsuite/lib/Makefile
config.status: creating testsuite/pdfgrep.tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
--->  Building pdfgrep
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1" && /usr/bin/make -j4 -w all 
make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1'
/usr/bin/make  all-recursive
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1'
Making all in src
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1/src'
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT pdfgrep.o -MD -MP -MF .deps/pdfgrep.Tpo -c -o pdfgrep.o pdfgrep.cc
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT output.o -MD -MP -MF .deps/output.Tpo -c -o output.o output.cc
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT exclude.o -MD -MP -MF .deps/exclude.Tpo -c -o exclude.o exclude.cc
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT regengine.o -MD -MP -MF .deps/regengine.Tpo -c -o regengine.o regengine.cc
mv -f .deps/exclude.Tpo .deps/exclude.Po
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT search.o -MD -MP -MF .deps/search.Tpo -c -o search.o search.cc
mv -f .deps/output.Tpo .deps/output.Po
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT cache.o -MD -MP -MF .deps/cache.Tpo -c -o cache.o cache.cc
mv -f .deps/regengine.Tpo .deps/regengine.Po
/opt/local/bin/clang++-mp-9.0 -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include/poppler/cpp -I/opt/local/include/poppler    -I/opt/local/include -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64 -MT intervals.o -MD -MP -MF .deps/intervals.Tpo -c -o intervals.o intervals.cc
mv -f .deps/search.Tpo .deps/search.Po
cache.cc:113:10: error: no matching function for call to 'scandir'
        int n = scandir(cache, &namelist, agefilter, agesort);
                ^~~~~~~
/usr/include/dirent.h:128:5: note: candidate function not viable: no known conversion from 'int (const struct dirent *)' to 'int (*)(struct dirent *)' for 3rd argument
int scandir(const char *, struct dirent ***,
    ^
1 error generated.
make[2]: *** [cache.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/pdfgrep.Tpo .deps/pdfgrep.Po
mv -f .deps/intervals.Tpo .deps/intervals.Po
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/work/pdfgrep-2.1.1" && /usr/bin/make -j4 -w all 
Exit code: 2
Error: Failed to build pdfgrep: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_pdfgrep/pdfgrep/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port pdfgrep failed
bash-3.2$

Attachments (1)

main.log (134.4 KB) - added by RobK88 4 years ago.
main.log

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by RobK88

Attachment: main.log added

main.log

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: raimue@… removed
Owner: set to raimue
Status: newassigned

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

the scandir calling convention changed about macOS 10.8. In the past, software used to test for the scandir ABI and use the one that the system used, but probably that has not been done lately, or removed if it was done before.

See [74405bfa3c405e2c316d669fba0a0a744cc6dad5/macports-ports] for a fix from another port that worked there.

I have wondered about a way to add this fix transparently in legacysupport, but so far haven't sorted it out.

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 4 years ago by jmroot (Joshua Root)

It's not an ABI difference, it's just different declared const-ness which the stricter compiler type checking in C++ doesn't like to mismatch.

Last edited 4 years ago by jmroot (Joshua Root) (previous) (diff)

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

yes --

In the past, software used to test for the scandir const-ness and use the one that the system used, but probably that has not been done lately, or removed if it was done before.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

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

Keywords: lion haspatch added; Lion removed
Summary: pdfgrep Fails to Build on Lionpdfgrep: error: no matching function for call to 'scandir'

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

Resolution: fixed
Status: assignedclosed

In 2c827c6432ea75095eaae8e7e1342aeefe35b3f9/macports-ports (master):

pdfgrep: Update to 2.1.2 and fix build on <= 10.7

Closes: #62108

Note: See TracTickets for help on using tickets.