Building LO on Raspberry pi 4b, error: unknown attribute 'externally_visible' on jni part

julien2412 serval2412 at
Thu Dec 31 10:54:23 UTC 2020

It seems "externally_visible" is a specific attribute of gcc (so not known by
Reading the link, it seems we can ignore this error since it's only useful
if we use "-fwhole-program" and "git grep" in LO code shows it's not the

So this patch removes the error:
diff --git a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
index 069bb1ee050e..95b1434dd9c1 100644
--- a/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
+++ b/bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c
@@ -23,7 +23,17 @@
 #include <X11/Xutil.h>
 #include <X11/Intrinsic.h>
+// to deal with gcc specific attribute "externally_visible" used in
+// /usr/lib/jvm/java-11-openjdk-armhf/include/linux/jni_md.h:35
+// via /usr/lib/jvm/java-11-openjdk-armhf/include/jni.h
+#if defined __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-attributes"
 #include <jni.h>
+#if defined __clang__
+#pragma clang diagnostic pop

but "jni.h" is used in about 40 files (if we remove comments with jni.h or
odk examples).

I suppose a better solution exists than copy pasting this  workaround 40
times or perhaps should I avoid clang here and use gcc?


Sent from:

More information about the LibreOffice mailing list