tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: c++ undefined symbols in lang/openjdk11



On Fri 03 Jan 2020 at 14:34:57 +0100, Rhialto wrote:
> I just wanted to report the problem quickly, but I'm looking into it
> right now.

It seems some issue with conformance level #defines.
From output of c++ -E -dID, I can see that /usr/include/math.h is
included (or more precisely, "/usr/pkg/gcc7/lib/gcc/x86_64--netbsd/7.4.0/include-fixed/math.h"), but this bit of it isn't:

#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
double  acosh(double);
double  asinh(double);
double  atanh(double);
...
#endif /* (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)*/

The command includes "-D_ALLBSD_SOURCE -D_BSDONLY_SOURCE" but neither
_XOPEN_SOURCE nor _NETBSD_SOURCE.

The following really horrible terrible patch makes it compile, but this
is of course no proper solution (but it might hint towards one):

$NetBSD$
  
--- src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh.orig    2019-10-16 18:31:09.000000000 +0000
+++ src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh
@@ -28,6 +28,9 @@

 #ifndef HB_HH
 #define HB_HH
+/* Terrible hack for <math.h> to declare double acosh(double) etc */
+#define _XOPEN_SOUCE 500
+#define _NETBSD_SOURCE 1

 #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC
 #if defined(_MSC_VER)


Full command line:

/pkg_comp/obj/pkgsrc/lang/openjdk11/default/.gcc/bin/g++ -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd-x86_64-normal-server-release/support/modules_include/java.base -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd-x86_64-normal-server-release/support/modules_include/java.base/netbsd -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.base/share/native/libjava -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.base/unix/native/libjava -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/hotspot/share/include -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/hotspot/os/posix/include -pipe -fstack-protector -D_ALLBSD_SOURCE -D_BSDONLY_SOURCE -D_REENTRANT -DBSD -DNDEBUG -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 -std=gnu++98 -m64-O2 -D_FORTIFY_SOURCE=2 -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/.buildlink/include -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/.x11-buildlink/include -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/.buildlink/include/freetype2 -I/usr/include/krb5 -D_LITTLE_ENDIAN '-DARCH="amd64"' -Damd64 -D_LP64=1 -fno-omit-frame-pointer -fno-delete-null-pointer-checks -fno-lifetime-dse -fPIC -fvisibility=hidden -std=c++11 -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN -DHAVE_ROUND -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD -DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHB_NO_PRAGMA_GCC_DIAGNOSTIC -DHAVE_INTEL_ATOMIC_PRIMITIVES -DLE_STANDALONE -DHEADLESS -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/unix/native/libfontmanager -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libfontmanager -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd-x86_64-normal-server-release/support/headers/java.desktop -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libfontmanager/harfbuzz -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/unix/native/common/awt -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/common/awt -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/unix/native/common/font -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/common/font -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/unix/native/libawt/java2d -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libawt/java2d -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libawt/java2d/pipe -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/unix/native/libawt/java2d/loops -I/pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libawt/java2d/loops -g -Wno-sign-compare -Wno-int-to-pointer-cast -Wno-type-limits -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-strict-aliasing -Wno-class-memaccess -Wno-reorder -Wno-delete-non-virtual-dtor -Wno-strict-overflow -Wno-maybe-uninitialized -O3 '-DTHIS_FILE=""' -E -dID /pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd-x86_64-normal-server-release/support/native/java.desktop/libfontmanager/hb-blob.d -o /tmp/hb-blob.E /pkg_comp/obj/pkgsrc/lang/openjdk11/default/openjdk-jdk11u-jdk-11.0.5-10-1/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc -specs=/pkg_comp/obj/pkgsrc/lang/openjdk11/default/.cwrapper/specs.libgcc -fstack-protector

obtained from work.log with -E -dID instead of -c, and adjusted -o option.

(It would be nice if there also was an option to output #if lines and their evaluation...)

-Olaf.
-- 
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___  Anyone who is capable of getting themselves made President should on
\X/  no account be allowed to do the job.       --Douglas Adams, "THGTTG"

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index