Skip to content
Permalink
Browse files
8265469: Allow to build media and webkit for Linux-AArch64
Reviewed-by: kcr, ajoseph
  • Loading branch information
Johan Vos committed Apr 23, 2021
1 parent dfda00d commit 27e57d34da31c23eccbbeb9a12e4cee5cb312a09
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
@@ -292,6 +292,7 @@ ext.MODULESOURCEPATH = "modulesourcepath.args"
ext.OS_NAME = System.getProperty("os.name").toLowerCase()
ext.OS_ARCH = System.getProperty("os.arch")
ext.IS_64 = OS_ARCH.toLowerCase().contains("64")
ext.IS_AARCH64 = OS_ARCH.toLowerCase().contains("aarch64")
ext.IS_MAC = OS_NAME.contains("mac") || OS_NAME.contains("darwin")
ext.IS_WINDOWS = OS_NAME.contains("windows")
ext.IS_LINUX = OS_NAME.contains("linux")
@@ -2863,7 +2864,7 @@ project(":media") {
args("JAVA_HOME=${JDK_HOME}", "GENERATED_HEADERS_DIR=${generatedHeadersDir}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=jfxmedia",
"COMPILE_PARFAIT=${compileParfait}",
IS_64 ? "ARCH=x64" : "ARCH=x32",
IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32",
"CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}")

if (t.name == "win") {
@@ -2890,7 +2891,7 @@ project(":media") {
exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/gstreamer-lite")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=gstreamer-lite",
IS_64 ? "ARCH=x64" : "ARCH=x32", "CC=${mediaProperties.compiler}",
IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32", "CC=${mediaProperties.compiler}",
"AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")

if (t.name == "win") {
@@ -2908,7 +2909,7 @@ project(":media") {
exec {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/fxplugins")
args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=fxplugins",
IS_64 ? "ARCH=x64" : "ARCH=x32",
IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32",
"CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")

if (t.name == "win") {
@@ -3218,7 +3219,8 @@ project(":media") {
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
"SUFFIX=", IS_64 ? "ARCH=x64" : "ARCH=x32")
"SUFFIX=", IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32",
"STATIC=${IS_STATIC_BUILD}")
}
}
}
@@ -3232,7 +3234,8 @@ project(":media") {
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
"SUFFIX=-ffmpeg", IS_64 ? "ARCH=x64" : "ARCH=x32")
"SUFFIX=-ffmpeg",
IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32")
}
}
}
@@ -3246,7 +3249,8 @@ project(":media") {
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
"SUFFIX=-ffmpeg", IS_64 ? "ARCH=x64" : "ARCH=x32")
"SUFFIX=-ffmpeg",
IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32")
}
}
}
@@ -3256,7 +3260,7 @@ project(":media") {
commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
"OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
"BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
"BASE_NAME=avplugin", IS_64 ? IS_AARCH64 ? "ARCH=aarch64" : "ARCH=x64" : "ARCH=x32")
}
}
}
@@ -3459,8 +3463,6 @@ project(":web") {
compileTargets { t ->
def targetProperties = project.rootProject.ext[t.upper]
def webkitProperties = targetProperties.webkit
def classifier = (t.name != "linux" && t.name != "win") ? t.name :
IS_64 ? "${t.name}-amd64" : "${t.name}-i586"

def webkitOutputDir = cygpath("$buildDir/${t.name}")
def webkitConfig = IS_DEBUG_NATIVE ? "Debug" : "Release"
@@ -3501,7 +3503,11 @@ project(":web") {
} else if (t.name == "linux") {
cmakeArgs = " $cmakeArgs -DCMAKE_SYSTEM_NAME=Linux"
if (IS_64) {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64"
if (IS_AARCH64) {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=aarch64"
} else {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=x86_64"
}
} else {
cmakeArgs = "$cmakeArgs -DCMAKE_SYSTEM_PROCESSOR=i586"
}
@@ -24,14 +24,17 @@ CFLAGS = -fPIC \
-fstack-protector \
-Werror=implicit-function-declaration \
-Werror=trampolines \
-msse2 \
-fbuiltin \
-DHAVE_STDINT_H \
-DLINUX \
-DGST_DISABLE_LOADSAVE \
-DGSTREAMER_LITE \
-ffunction-sections -fdata-sections

ifneq ($(ARCH), aarch64)
CFLAGS += -msse2
endif

ifeq ($(BUILD_TYPE), Release)
CFLAGS += -Os
else
@@ -21,7 +21,6 @@ CFLAGS = -fPIC \
-fstack-protector \
-Werror=implicit-function-declaration \
-Werror=trampolines \
-msse2 \
-fbuiltin \
-DHAVE_STDINT_H \
-DLINUX \
@@ -33,6 +32,10 @@ CFLAGS = -fPIC \
-DGSTREAMER_LITE \
-ffunction-sections -fdata-sections

ifneq ($(ARCH), aarch64)
CFLAGS += -msse2
endif

ifeq ($(BUILD_TYPE), Release)
CFLAGS += -Os
else
@@ -42,8 +42,11 @@ ifdef HOST_COMPILE
-Wformat-security \
-fstack-protector \
-Werror=trampolines \
-msse2 \
-DGSTREAMER_LITE
ifneq ($(ARCH), aarch64)
CFLAGS += -msse2
endif


PACKAGES_INCLUDES := $(shell pkg-config --cflags glib-2.0)
PACKAGES_LIBS := $(shell pkg-config --libs glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0)

1 comment on commit 27e57d3

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 27e57d3 Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.