diff options
author | Baruch Siach <baruch@tkos.co.il> | 2018-04-17 18:56:56 +0300 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2018-04-25 23:02:10 +0200 |
commit | d614a39f20fc8f0550afacc5af86f32fc19e8ce1 (patch) | |
tree | 900003c081948262dfd670f21bfcd00839b0df62 /package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch | |
parent | 603a4922c30d3c1f9603df857065205b803fe93f (diff) | |
download | buildroot-d614a39f20fc8f0550afacc5af86f32fc19e8ce1.tar.gz buildroot-d614a39f20fc8f0550afacc5af86f32fc19e8ce1.zip |
openblas: fix build with musl libc
Add upstream patches to avoid use of __GLIBC_PREREQ when this macro is
not defined.
Fixes:
http://autobuild.buildroot.net/results/f13/f13d93372449c9bf1b3c79ed056b8d820470ae89/
http://autobuild.buildroot.net/results/e1c/e1cdcdfe15b4af523c7db71952ac25163733ffb1/
http://autobuild.buildroot.net/results/778/77821a4a37171080fc7ee917862e77babeb06b88/
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch')
-rw-r--r-- | package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch b/package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch new file mode 100644 index 0000000000..be4833f4a8 --- /dev/null +++ b/package/openblas/0003-Fix-build-when-__GLIBC_PREREQ-is-not-defined.patch @@ -0,0 +1,45 @@ +From 84eaad62e95b9a80df2138db3fed2a186ef00b62 Mon Sep 17 00:00:00 2001 +From: Baruch Siach <baruch@tkos.co.il> +Date: Tue, 17 Apr 2018 18:46:29 +0300 +Subject: [PATCH] Fix build when __GLIBC_PREREQ is not defined + +Rearrange the code so that __GLIBC_PREREQ is not used when not defined. +This fixes build with musl libc. + +[baruch: backport to v0.2.20] +Signed-off-by: Baruch Siach <baruch@tkos.co.il> +--- +Upstream status: combines upstream commits 480e69768176 and c4af196a2d +--- + driver/others/init.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/driver/others/init.c b/driver/others/init.c +index 4c75d72e4075..adce075f0ac0 100644 +--- a/driver/others/init.c ++++ b/driver/others/init.c +@@ -838,7 +838,11 @@ void gotoblas_affinity_init(void) { + + nums = sysconf(_SC_NPROCESSORS_CONF); + +-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 3) ++#if !defined(__GLIBC_PREREQ) ++ common->num_procs = nums; ++#else ++ ++#if !__GLIBC_PREREQ(2, 3) + common->num_procs = nums; + #elif __GLIBC_PREREQ(2, 7) + cpusetp = CPU_ALLOC(nums); +@@ -872,6 +876,8 @@ void gotoblas_affinity_init(void) { + + #endif + ++#endif ++ + if(common -> num_procs > MAX_CPUS) { + fprintf(stderr, "\nOpenBLAS Warning : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS); + exit(1); +-- +2.17.0 + |