diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2026-09-27 03:30:14 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-27 03:30:14 -0300 |
| commit | 227d241c83f476ccb53a2a274af29df6be584a09 (patch) | |
| tree | 95e66e9f2b857c27c9174eeb15a912cdaae61227 | |
| parent | 936c852985823886c4cb25166d02a01139c18a43 (diff) | |
| parent | ba2685633efcbf4b6c2373436754f6354b0d116d (diff) | |
| download | meta-freescale-227d241c83f476ccb53a2a274af29df6be584a09.tar.gz | |
Merge pull request #2743 from YoeDistro/yoe/mut
Support blacksail and fix build with clang
| -rw-r--r-- | conf/layer.conf | 2 | ||||
| -rw-r--r-- | recipes-graphics/imx-g2d/imx-dpu-g2d/0002-g2d_utils-Store-strtol-result-in-a-long.patch | 49 | ||||
| -rw-r--r-- | recipes-graphics/imx-g2d/imx-dpu-g2d_git.bb | 1 |
3 files changed, 51 insertions, 1 deletions
diff --git a/conf/layer.conf b/conf/layer.conf index 9fcb322fe..76b141e06 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
| @@ -8,7 +8,7 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | |||
| 8 | BBFILE_COLLECTIONS += "freescale-layer" | 8 | BBFILE_COLLECTIONS += "freescale-layer" |
| 9 | BBFILE_PATTERN_freescale-layer := "^${LAYERDIR}/" | 9 | BBFILE_PATTERN_freescale-layer := "^${LAYERDIR}/" |
| 10 | BBFILE_PRIORITY_freescale-layer = "5" | 10 | BBFILE_PRIORITY_freescale-layer = "5" |
| 11 | LAYERSERIES_COMPAT_freescale-layer = "whinlatter wrynose" | 11 | LAYERSERIES_COMPAT_freescale-layer = "whinlatter wrynose blacksail" |
| 12 | LAYERDEPENDS_freescale-layer = "core" | 12 | LAYERDEPENDS_freescale-layer = "core" |
| 13 | 13 | ||
| 14 | # Add the Freescale-specific licenses into the metadata | 14 | # Add the Freescale-specific licenses into the metadata |
diff --git a/recipes-graphics/imx-g2d/imx-dpu-g2d/0002-g2d_utils-Store-strtol-result-in-a-long.patch b/recipes-graphics/imx-g2d/imx-dpu-g2d/0002-g2d_utils-Store-strtol-result-in-a-long.patch new file mode 100644 index 000000000..b549a8d65 --- /dev/null +++ b/recipes-graphics/imx-g2d/imx-dpu-g2d/0002-g2d_utils-Store-strtol-result-in-a-long.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From: Khem Raj <raj.khem@gmail.com> | ||
| 2 | Date: Sat, 26 Sep 2026 12:00:00 -0700 | ||
| 3 | Subject: [PATCH] g2d_utils: Store strtol() result in a long | ||
| 4 | |||
| 5 | getSystemEnvInt() assigns the result of strtol() to an int and then | ||
| 6 | compares it with LONG_MAX/LONG_MIN. On LP64 targets the value is | ||
| 7 | truncated before the comparison, so the ERANGE overflow check can never | ||
| 8 | trigger. Clang diagnoses this: | ||
| 9 | |||
| 10 | os/linux/g2d_utils.c:33:31: error: result of comparison of constant | ||
| 11 | 9223372036854775807 with expression of type 'int' is always false | ||
| 12 | [-Werror,-Wtautological-constant-out-of-range-compare] | ||
| 13 | |||
| 14 | Keep the value in a long, reject values that do not fit in an int, and | ||
| 15 | narrow explicitly on return. | ||
| 16 | |||
| 17 | Upstream-Status: Pending | ||
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 19 | --- | ||
| 20 | source/os/linux/g2d_utils.c | 7 ++++--- | ||
| 21 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/source/os/linux/g2d_utils.c b/source/os/linux/g2d_utils.c | ||
| 24 | index 1321f8a..c6079da 100644 | ||
| 25 | --- a/source/os/linux/g2d_utils.c | ||
| 26 | +++ b/source/os/linux/g2d_utils.c | ||
| 27 | @@ -17,7 +17,7 @@ enum g2d_ocl_enabled { G2D_OCL_UNKNOWN, G2D_OCL_ENABLED, G2D_OCL_DISABLED }; | ||
| 28 | static atomic_int g_g2d_ocl_status = G2D_OCL_UNKNOWN; | ||
| 29 | static int getSystemEnvInt(char *prop) | ||
| 30 | { | ||
| 31 | - int val; | ||
| 32 | + long val; | ||
| 33 | #ifdef ANDROID | ||
| 34 | char env[PROPERTY_VALUE_MAX]; | ||
| 35 | property_get("vendor.2d.ocl.enable", env, "1"); | ||
| 36 | @@ -31,10 +31,11 @@ static int getSystemEnvInt(char *prop) | ||
| 37 | errno = 0; /* To distinguish success/failure after call */ | ||
| 38 | val = strtol(env, NULL, 10); | ||
| 39 | if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) | ||
| 40 | - || (errno != 0 && val == 0)) { | ||
| 41 | + || (errno != 0 && val == 0) | ||
| 42 | + || val > INT_MAX || val < INT_MIN) { | ||
| 43 | return -EINVAL; | ||
| 44 | } | ||
| 45 | - return val; | ||
| 46 | + return (int)val; | ||
| 47 | } | ||
| 48 | |||
| 49 | int isOCLEnabled() | ||
diff --git a/recipes-graphics/imx-g2d/imx-dpu-g2d_git.bb b/recipes-graphics/imx-g2d/imx-dpu-g2d_git.bb index 6266b4a29..36489c4f9 100644 --- a/recipes-graphics/imx-g2d/imx-dpu-g2d_git.bb +++ b/recipes-graphics/imx-g2d/imx-dpu-g2d_git.bb | |||
| @@ -21,6 +21,7 @@ PV = "2.5.0+git" | |||
| 21 | SRC_URI = "\ | 21 | SRC_URI = "\ |
| 22 | ${IMX_DPU_G2D_SRC};branch=${SRCBRANCH} \ | 22 | ${IMX_DPU_G2D_SRC};branch=${SRCBRANCH} \ |
| 23 | file://0001-g2d-Remove-unused-totalUsed-variable.patch;patchdir=.. \ | 23 | file://0001-g2d-Remove-unused-totalUsed-variable.patch;patchdir=.. \ |
| 24 | file://0002-g2d_utils-Store-strtol-result-in-a-long.patch;patchdir=.. \ | ||
| 24 | " | 25 | " |
| 25 | IMX_DPU_G2D_SRC ?= "git://github.com/nxp-imx/imx-dpu-g2d.git;protocol=https" | 26 | IMX_DPU_G2D_SRC ?= "git://github.com/nxp-imx/imx-dpu-g2d.git;protocol=https" |
| 26 | SRCBRANCH = "imx_2.5" | 27 | SRCBRANCH = "imx_2.5" |
