Bug 234251 - graphics/xpdf4:fix build with GCC-based architectures
Summary: graphics/xpdf4:fix build with GCC-based architectures
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-21 16:02 UTC by Piotr Kubaj
Modified: 2018-12-24 18:30 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
patch (926 bytes, patch)
2018-12-21 16:02 UTC, Piotr Kubaj
no flags Details | Diff
v2 (1.66 KB, patch)
2018-12-21 16:12 UTC, Piotr Kubaj
no flags Details | Diff
fix for PR 234251 (1.42 KB, patch)
2018-12-23 18:56 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2018-12-21 16:02:07 UTC
Created attachment 200338 [details]
patch

This port needs USES=compiler:c++11-lang to build on GCC architectures.

It detects FreeBSD by checking for macro __FreeBSD_cc_version, which clang defines, but GCC doesn't, so define that too (only relevant to PRINT option).

While here, replace LDFLAGS with USES=localbase:ldflags.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Piotr Kubaj freebsd_committer 2018-12-21 16:12:31 UTC
Created attachment 200340 [details]
v2

I can see now it's our patch at fault, so fix it instead of doing Makefile magic.
Comment 2 Cy Schubert freebsd_committer 2018-12-21 20:42:41 UTC
Your patch broke the build when building with clang.

[127/127] : && /usr/bin/c++  -O2 -pipe -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -O2 -pipe -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -fstack-protector goo/CMakeFiles/goo_objs.dir/FixedPoint.cc.o goo/CMakeFiles/goo_objs.dir/GHash.cc.o goo/CMakeFiles/goo_objs.dir/GList.cc.o goo/CMakeFiles/goo_objs.dir/GString.cc.o goo/CMakeFiles/goo_objs.dir/gfile.cc.o goo/CMakeFiles/goo_objs.dir/gmem.cc.o goo/CMakeFiles/goo_objs.dir/gmempp.cc.o goo/CMakeFiles/goo_objs.dir/parseargs.c.o fofi/CMakeFiles/fofi_objs.dir/FoFiBase.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiEncodings.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiIdentifier.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiTrueType.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiType1.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiType1C.cc.o splash/CMakeFiles/splash_objs.dir/Splash.cc.o splash/CMakeFiles/splash_objs.dir/SplashBitmap.cc.o splash/CMakeFiles/splash_objs.dir/SplashClip.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFont.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFontEngine.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFontFile.cc.o splash/CMakeFiles/splash_objs.dir/SplashFont.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontEngine.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontFile.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontFileID.cc.o splash/CMakeFiles/splash_objs.dir/SplashPath.cc.o splash/CMakeFiles/splash_objs.dir/SplashPattern.cc.o splash/CMakeFiles/splash_objs.dir/SplashScreen.cc.o splash/CMakeFiles/splash_objs.dir/SplashState.cc.o splash/CMakeFiles/splash_objs.dir/SplashXPath.cc.o splash/CMakeFiles/splash_objs.dir/SplashXPathScanner.cc.o xpdf/CMakeFiles/xpdf_objs.dir/AcroForm.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Annot.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Array.cc.o xpdf/CMakeFiles/xpdf_objs.dir/BuiltinFont.cc.o xpdf/CMakeFiles/xpdf_objs.dir/BuiltinFontTables.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Catalog.cc.o xpdf/CMakeFiles/xpdf_objs.dir/CharCodeToUnicode.cc.o xpdf/CMakeFiles/xpdf_objs.dir/CMap.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Decrypt.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Dict.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Error.cc.o xpdf/CMakeFiles/xpdf_objs.dir/FontEncodingTables.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Form.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Function.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Gfx.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GfxFont.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GfxState.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GlobalParams.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JArithmeticDecoder.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JBIG2Stream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JPXStream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Lexer.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Link.cc.o xpdf/CMakeFiles/xpdf_objs.dir/NameToCharCode.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Object.cc.o xpdf/CMakeFiles/xpdf_objs.dir/OptionalContent.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Outline.cc.o xpdf/CMakeFiles/xpdf_objs.dir/OutputDev.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Page.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Parser.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PDFDoc.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PDFDocEncoding.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PSTokenizer.cc.o xpdf/CMakeFiles/xpdf_objs.dir/SecurityHandler.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Stream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/TextString.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UnicodeMap.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UnicodeTypeTable.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UTF8.cc.o xpdf/CMakeFiles/xpdf_objs.dir/XFAForm.cc.o xpdf/CMakeFiles/xpdf_objs.dir/XRef.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Zoox.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/DisplayState.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PDFCore.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PreScanOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PSOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/SplashOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TextOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileCache.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileCompositor.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileMap.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfWidgetPrint.cc.o xpdf-qt/CMakeFiles/xpdf.dir/QtPDFCore.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfApp.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfViewer.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfWidget.cc.o xpdf-qt/CMakeFiles/xpdf.dir/xpdf.cc.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfApp.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfViewer.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfWidget.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/qrc_icons.cpp.o  -o xpdf-qt/xpdf  -Wl,-rpath,/usr/local/lib/qt5:/usr/local/lib: /usr/local/lib/qt5/libQt5PrintSupport.so.5.10.1 -lcups -lcups /usr/local/lib/libfreetype.so -pthread /usr/local/lib/qt5/libQt5Widgets.so.5.10.1 /usr/local/lib/qt5/libQt5Gui.so.5.10.1 /usr/local/lib/qt5/libQt5Core.so.5.10.1 -Wl,-rpath-link,/usr/local/lib && :
FAILED: xpdf-qt/xpdf 
: && /usr/bin/c++  -O2 -pipe -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -O2 -pipe -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -fstack-protector goo/CMakeFiles/goo_objs.dir/FixedPoint.cc.o goo/CMakeFiles/goo_objs.dir/GHash.cc.o goo/CMakeFiles/goo_objs.dir/GList.cc.o goo/CMakeFiles/goo_objs.dir/GString.cc.o goo/CMakeFiles/goo_objs.dir/gfile.cc.o goo/CMakeFiles/goo_objs.dir/gmem.cc.o goo/CMakeFiles/goo_objs.dir/gmempp.cc.o goo/CMakeFiles/goo_objs.dir/parseargs.c.o fofi/CMakeFiles/fofi_objs.dir/FoFiBase.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiEncodings.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiIdentifier.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiTrueType.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiType1.cc.o fofi/CMakeFiles/fofi_objs.dir/FoFiType1C.cc.o splash/CMakeFiles/splash_objs.dir/Splash.cc.o splash/CMakeFiles/splash_objs.dir/SplashBitmap.cc.o splash/CMakeFiles/splash_objs.dir/SplashClip.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFont.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFontEngine.cc.o splash/CMakeFiles/splash_objs.dir/SplashFTFontFile.cc.o splash/CMakeFiles/splash_objs.dir/SplashFont.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontEngine.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontFile.cc.o splash/CMakeFiles/splash_objs.dir/SplashFontFileID.cc.o splash/CMakeFiles/splash_objs.dir/SplashPath.cc.o splash/CMakeFiles/splash_objs.dir/SplashPattern.cc.o splash/CMakeFiles/splash_objs.dir/SplashScreen.cc.o splash/CMakeFiles/splash_objs.dir/SplashState.cc.o splash/CMakeFiles/splash_objs.dir/SplashXPath.cc.o splash/CMakeFiles/splash_objs.dir/SplashXPathScanner.cc.o xpdf/CMakeFiles/xpdf_objs.dir/AcroForm.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Annot.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Array.cc.o xpdf/CMakeFiles/xpdf_objs.dir/BuiltinFont.cc.o xpdf/CMakeFiles/xpdf_objs.dir/BuiltinFontTables.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Catalog.cc.o xpdf/CMakeFiles/xpdf_objs.dir/CharCodeToUnicode.cc.o xpdf/CMakeFiles/xpdf_objs.dir/CMap.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Decrypt.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Dict.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Error.cc.o xpdf/CMakeFiles/xpdf_objs.dir/FontEncodingTables.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Form.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Function.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Gfx.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GfxFont.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GfxState.cc.o xpdf/CMakeFiles/xpdf_objs.dir/GlobalParams.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JArithmeticDecoder.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JBIG2Stream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/JPXStream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Lexer.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Link.cc.o xpdf/CMakeFiles/xpdf_objs.dir/NameToCharCode.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Object.cc.o xpdf/CMakeFiles/xpdf_objs.dir/OptionalContent.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Outline.cc.o xpdf/CMakeFiles/xpdf_objs.dir/OutputDev.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Page.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Parser.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PDFDoc.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PDFDocEncoding.cc.o xpdf/CMakeFiles/xpdf_objs.dir/PSTokenizer.cc.o xpdf/CMakeFiles/xpdf_objs.dir/SecurityHandler.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Stream.cc.o xpdf/CMakeFiles/xpdf_objs.dir/TextString.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UnicodeMap.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UnicodeTypeTable.cc.o xpdf/CMakeFiles/xpdf_objs.dir/UTF8.cc.o xpdf/CMakeFiles/xpdf_objs.dir/XFAForm.cc.o xpdf/CMakeFiles/xpdf_objs.dir/XRef.cc.o xpdf/CMakeFiles/xpdf_objs.dir/Zoox.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/DisplayState.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PDFCore.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PreScanOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/PSOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/SplashOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TextOutputDev.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileCache.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileCompositor.cc.o xpdf/CMakeFiles/xpdf_widget_objs.dir/TileMap.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfWidgetPrint.cc.o xpdf-qt/CMakeFiles/xpdf.dir/QtPDFCore.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfApp.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfViewer.cc.o xpdf-qt/CMakeFiles/xpdf.dir/XpdfWidget.cc.o xpdf-qt/CMakeFiles/xpdf.dir/xpdf.cc.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfApp.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfViewer.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/moc_XpdfWidget.cpp.o xpdf-qt/CMakeFiles/xpdf.dir/qrc_icons.cpp.o  -o xpdf-qt/xpdf  -Wl,-rpath,/usr/local/lib/qt5:/usr/local/lib: /usr/local/lib/qt5/libQt5PrintSupport.so.5.10.1 -lcups -lcups /usr/local/lib/libfreetype.so -pthread /usr/local/lib/qt5/libQt5Widgets.so.5.10.1 /usr/local/lib/qt5/libQt5Gui.so.5.10.1 /usr/local/lib/qt5/libQt5Core.so.5.10.1 -Wl,-rpath-link,/usr/local/lib && :
ld: error: unable to find library -lcups
ld: error: unable to find library -lcups
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /export/home/cy/freebsd/git/ports/graphics/xpdf4
*** Error code 1

Stop.
make: stopped in /export/home/cy/freebsd/git/ports/graphics/xpdf4
slippy$
Comment 3 Cy Schubert freebsd_committer 2018-12-21 20:46:19 UTC
The problem was this: While here, replace LDFLAGS with USES=localbase:ldflags.
Comment 4 Piotr Kubaj freebsd_committer 2018-12-23 02:03:43 UTC
(In reply to Cy Schubert from comment #3)
Hm, strange. Could you then commit USES=compiler:c++11-lang and s/_FreeBSD_cc_version/__FreeBSD__/?
Comment 5 Cy Schubert freebsd_committer 2018-12-23 02:09:52 UTC
I'm rebuilding it in a clean jail in case my "prod" environment is a little "off."
Comment 6 Cy Schubert freebsd_committer 2018-12-23 18:56:36 UTC
Created attachment 200408 [details]
fix for PR 234251

Can you try this on your PPC?
Comment 7 commit-hook freebsd_committer 2018-12-24 18:29:45 UTC
A commit references this bug:

Author: cy
Date: Mon Dec 24 18:29:41 UTC 2018
New revision: 488279
URL: https://svnweb.freebsd.org/changeset/ports/488279

Log:
  Fix GCC build.

  This commit is based (not entirely) on a patch submitted by
  Poitr Kubaj <pkubaj@anongoth.pl> in PR 234251.

  PR:		234251

Changes:
  head/graphics/xpdf4/Makefile
  head/graphics/xpdf4/files/patch-xpdf-qt_XpdfWidgetPrint.cc
Comment 8 Cy Schubert freebsd_committer 2018-12-24 18:30:57 UTC
Fixed. Thanks for the initial patch.