FreeBSD Bugzilla – Attachment 239563 Details for
Bug 269034
java/eclipse: fix build with clang 15
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
java/eclipse: fix build with clang 15
java__eclipse-fix-clang15-build-1.diff (text/plain), 5.30 KB, created by
Dimitry Andric
on 2023-01-18 20:19:20 UTC
(
hide
)
Description:
java/eclipse: fix build with clang 15
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2023-01-18 20:19:20 UTC
Size:
5.30 KB
patch
obsolete
>commit f837adba48155bdfefc274c6e1656350c63443b9 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: Wed Jan 18 21:11:36 2023 +0100 > > java/eclipse: fix build with clang 15 > > During an exp-run for llvm 15 (see bug 265425), it turned out that > java/eclipse failed to build with clang 15: > > [INFO] [exec] Building GTK3 bindings: > [INFO] [exec] gmake[1]: Entering directory '/wrkdirs/usr/ports/java/eclipse/work/eclipse.platform.releng.aggregator-R4_24/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.gtk.freebsd.amd64/tmpdir' > ... > [INFO] [exec] cc -O -Wall -fPIC -DSWT_VERSION=4952r11 -DFREEBSD -DGTK -I`pkg-config --variable=prefix gtk+-3.0`/include -I/usr/local/openjdk11/include -I/usr/local/openjdk11/include/freebsd -DJNI64 -m64 -Werror `pkg-config --cflags gtk+-3.0 gtk+-unix-print-3.0` -c os.c > [INFO] [exec] os.c:10086:31: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] > [INFO] [exec] rc = (jint)((jint (*)())arg0)(arg1, arg2, arg3); > [INFO] [exec] ^ > [INFO] [exec] os.c:10098:31: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] > [INFO] [exec] rc = (jint)((jint (*)())arg0)(arg1, arg2); > [INFO] [exec] ^ > [INFO] [exec] os.c:10704:33: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] > [INFO] [exec] rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4); > [INFO] [exec] ^ > [INFO] [exec] os.c:10716:33: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] > [INFO] [exec] rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4, arg5, arg6); > [INFO] [exec] ^ > [INFO] [exec] os.c:10728:33: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] > [INFO] [exec] rc = (jlong)((jlong (*)())arg0)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); > [INFO] [exec] ^ > > These -Werror warnings are in code generated by JNIGenerator, so they > cannot directly be fixed (at least not without hacking on JNIGenerator > itself). > > Instead we need to add -Wno-deprecated-non-prototype for clang 15 and > higher. To achieve this, we have to pass CFLAGS to MAVEN_ENV, and adjust > the gtk build.sh script to respect the CFLAGS setting in the > environment. > >diff --git a/java/eclipse/Makefile b/java/eclipse/Makefile >index c51253580d9a..83ccfbd15d21 100644 >--- a/java/eclipse/Makefile >+++ b/java/eclipse/Makefile >@@ -65,13 +65,19 @@ DESKTOP_ENTRIES="Eclipse" \ > > SUB_FILES= ${PORTNAME} > >-MAVEN_ENV= MAVEN_OPTS=-Xmx1024m CC=${CC} JAVA_HOME=${JAVA_HOME} HOME=${WRKDIR}/githome >+MAVEN_ENV= MAVEN_OPTS=-Xmx1024m CC=${CC} CFLAGS="${CFLAGS}" JAVA_HOME=${JAVA_HOME} HOME=${WRKDIR}/githome > MAVEN_ECLIPSE= -Dmaven.repo.local=${WRKDIR}/eclipse-maven-repo-${PORTVERSION} \ > -Dnative=gtk.freebsd.${ARCH} \ > -DforceContextQualifier=v${ECLIPSE_TSTAMP} > > ECLIPSE_RESULT= eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/org.eclipse.sdk.ide-freebsd.gtk.${ARCH}.tar.gz > >+.include <bsd.port.pre.mk> >+ >+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 150 >+CFLAGS+= -Wno-deprecated-non-prototype >+.endif >+ > do-build: > cd ${WRKSRC} && ${SETENV} ${MAVEN_ENV} mvn --offline ${MAVEN_ECLIPSE} -DskipTests clean verify > >@@ -85,4 +91,4 @@ post-install: > cd ${STAGEDIR}${PREFIX} && ${FIND} -s bin/${PORTNAME} share/${PORTNAME} -not -type d >> ${TMPPLIST} > cd ${STAGEDIR}${PREFIX} && ${FIND} -ds share/${PORTNAME} -type d | ${SED} -e 's,^,@dir ,' >> ${TMPPLIST} > >-.include <bsd.port.mk> >+.include <bsd.port.post.mk> >diff --git a/java/eclipse/files/patch-eclipse.platform.swt b/java/eclipse/files/patch-eclipse.platform.swt >index dc00b69720aa..f767ccd32b14 100644 >--- a/java/eclipse/files/patch-eclipse.platform.swt >+++ b/java/eclipse/files/patch-eclipse.platform.swt >@@ -53,15 +53,18 @@ diff -ru eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/common/org/ > diff -ru eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh > --- eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh 0000-00-00 00:00:00.000000000 +0000 > +++ eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh 0000-00-00 00:00:00.000000000 +0000 >-@@ -72,7 +72,7 @@ >+@@ -72,9 +72,9 @@ > > cd `dirname $0` > > -MAKE_TYPE=make > +MAKE_TYPE=gmake > >- export CFLAGS='-O -Wall -fPIC' >+-export CFLAGS='-O -Wall -fPIC' >++export CFLAGS="${CFLAGS--O -Wall} -fPIC" > >+ # Determine which OS we are on >+ if [ "${OS}" = "" ]; then > @@ -86,27 +86,30 @@ > MAKEFILE=make_win32.mak > ;;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 269034
: 239563