Description: Filter empty entries out of the dpkg-buildflags output.
 When dpkg-buildflags returns no flags (which happens in this build
 environment because the dpkg vendor provides no default build flags),
 splitting its empty output on " " yields a single empty string. That
 empty string is then passed as an argument to gcc/g++ and the native
 build fails with:
 gcc: error: : linker input file not found: No such file or directory
 Skip empty entries so that only real flags are passed to the compiler
 and linker.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: no
Last-Update: 2026-09-16
--- openjfx-11.0.11+1.orig/buildSrc/linux.gradle
+++ openjfx-11.0.11+1/buildSrc/linux.gradle
@@ -48,8 +48,8 @@ def commonFlags = [
         "-Wno-error=deprecated-declarations",
         "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=trampolines"] // warning flags
 
-commonFlags.addAll("dpkg-buildflags --get CPPFLAGS  ".execute().text.trim().split(" "))
-commonFlags.addAll("dpkg-buildflags --get CXXFLAGS".execute().text.trim().split(" "))
+commonFlags.addAll("dpkg-buildflags --get CPPFLAGS  ".execute().text.trim().split(" ").findAll { !it.isEmpty() })
+commonFlags.addAll("dpkg-buildflags --get CXXFLAGS".execute().text.trim().split(" ").findAll { !it.isEmpty() })
 
 if (IS_STATIC_BUILD) {
     commonFlags += "-DSTATIC_BUILD"
@@ -65,12 +65,12 @@ def cFlags = [cppFlags, "-Werror=implici
 
 def ccFlagsGTK3 = cppFlags
 //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
-cppFlags.addAll("dpkg-buildflags --get CPPFLAGS  ".execute().text.trim().split(" "))
-cppFlags.addAll("dpkg-buildflags --get CXXFLAGS".execute().text.trim().split(" "))
+cppFlags.addAll("dpkg-buildflags --get CPPFLAGS  ".execute().text.trim().split(" ").findAll { !it.isEmpty() })
+cppFlags.addAll("dpkg-buildflags --get CXXFLAGS".execute().text.trim().split(" ").findAll { !it.isEmpty() })
 def dynamicLinkFlags = ["-static-libgcc", "-static-libstdc++", "-shared", commonFlags,
                  "-z", "relro",
                  "-Wl,--gc-sections"].flatten()
-dynamicLinkFlags.addAll("dpkg-buildflags --get LDFLAGS".execute().text.trim().split(" "))
+dynamicLinkFlags.addAll("dpkg-buildflags --get LDFLAGS".execute().text.trim().split(" ").findAll { !it.isEmpty() })
 
 def staticLinkFlags = [].flatten()
 
