tech-pkg archive

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

Re: c++ undeclared symbols in lang/openjdk11



On Fri 03 Jan 2020 at 11:44:42 -0500, Greg Troxel wrote:
> I wonder if you can find out what visibilty define is being turned on,
> as in the absence of any, _NETBSD_SOURCE is enabled.

I looked at the .E output from before, and it was simpler than I thought
at first. The hb-blob.cc file being compiled begins with

/* https://github.com/harfbuzz/harfbuzz/issues/1308
 * http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
 * https://www.oracle.com/technetwork/articles/servers-storage-dev/standardheaderfiles-453865.html
 */
#ifndef _POSIX_C_SOURCE
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-macros"
#define _POSIX_C_SOURCE 200809L
#pragma GCC diagnostic pop
#endif

Given what we know about the visibility macros (that they restrict,
rather than extend) the second reference seems particularly misleading.
It can easily be read as saying that defining these macros extends
visibility -- but it really says that only compared to "gcc -ansi".
The top paragraphs seem to sort of imply this but the bottom two make it
much more clear; probably most people don't read that far.

The 3rd reference does not exist any more.

I have now built (NetBSD 8.1/amd64, gcc7-7.4.0nb3) with the following
patch, and it completed successfully. I would expect gcc (nb3 20180905)
5.5.0 from 8.1's base to work as well, but I have not tried it yet.
If somebody can confirm that before I can, I would propose to add this
patch.

$NetBSD$

--- src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc.orig	2019-10-16 18:31:09.000000000 +0000
+++ src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc
@@ -30,12 +30,6 @@
  * http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
  * https://www.oracle.com/technetwork/articles/servers-storage-dev/standardheaderfiles-453865.html
  */
-#ifndef _POSIX_C_SOURCE
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-macros"
-#define _POSIX_C_SOURCE 200809L
-#pragma GCC diagnostic pop
-#endif
 
 #include "hb.hh"
 #include "hb-blob.hh"

Harfbuzz included in openjdk11 seems to be 2.3.1; pkgsrc has 2.6.4 and
doesn't need a similar patch even with gcc7. It has a different
condition instead:

#if !defined(_POSIX_C_SOURCE) && !defined(_MSC_VER) && !defined(__NetBSD__)

I'm not sure this is better; this could only work properly if other OSes
by default include some visibility-limiting define and _POSIX_C_SOURCE
here would add features instead of removing them (or on other systems
they get the effect of the defines wrong...)

-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