* [Buildroot] [PATCH 1/1] fix help text wrapping for configs starting with 'a'
From: Adam Duskett @ 2017-05-05 10:33 UTC (permalink / raw)
To: buildroot
The check-package script when ran gives warnings on text wrapping
on all of these Config files. This patch cleans up all warnings
related to the text wrapping for the Config files starting with
the letter a in the package directory.
The appropriate indentation is: <tab><2 spaces><62 chars>
See http://nightly.buildroot.org/#writing-rules-config-in for more
information.
http://nightly.buildroot.org/#writing-rules-config-in
Signed-off-by: Adam Duskett <aduskett@codeblue.com>
---
package/a10disp/Config.in | 5 +++--
package/acpid/Config.in | 5 +++--
package/aespipe/Config.in | 9 +++++----
package/agentpp/Config.in | 16 +++++++++-------
package/alsa-lib/Config.in | 5 +++--
package/apache/Config.in | 18 ++++++++++--------
package/apr/Config.in | 7 ++++---
package/assimp/Config.in | 9 +++++----
package/aubio/Config.in | 22 ++++++++++++----------
package/aufs-util/Config.in | 14 ++++++++------
package/autossh/Config.in | 5 +++--
11 files changed, 65 insertions(+), 50 deletions(-)
diff --git a/package/a10disp/Config.in b/package/a10disp/Config.in
index 18e2d8f..3c27b58 100644
--- a/package/a10disp/Config.in
+++ b/package/a10disp/Config.in
@@ -3,8 +3,9 @@ config BR2_PACKAGE_A10DISP
depends on BR2_arm
depends on BR2_LINUX_KERNEL
help
- Program to change the display mode of Allwinner ARM SOCs running
- the linux-sunxi kernel (and not the mainline kernel.)
+ Program to change the display mode of Allwinner
+ ARM SOCs running the linux-sunxi kernel
+ (and not the mainline kernel.)
http://github.com/hglm/a10disp
diff --git a/package/acpid/Config.in b/package/acpid/Config.in
index 5aec7f1..2bd83ea 100644
--- a/package/acpid/Config.in
+++ b/package/acpid/Config.in
@@ -4,7 +4,8 @@ config BR2_PACKAGE_ACPID
help
Advanced Configuration and Power Interface event daemon.
- Acpid is designed to notify user-space programs of ACPI events,
- and allows you to configure specific actions for specific events.
+ Acpid is designed to notify user-space programs of ACPI
+ events, and allows you to configure specific actions for
+ specific events.
http://sourceforge.net/projects/acpid2/
diff --git a/package/aespipe/Config.in b/package/aespipe/Config.in
index df99523..0140c94 100644
--- a/package/aespipe/Config.in
+++ b/package/aespipe/Config.in
@@ -2,9 +2,10 @@ config BR2_PACKAGE_AESPIPE
bool "aespipe"
depends on BR2_USE_MMU # fork()
help
- aespipe program is AES encrypting or decrypting pipe. It reads from
- standard input and writes to standard output. It can be used to
- create and restore encrypted tar or cpio archives. It can be used to
- encrypt and decrypt loop-AES compatible encrypted disk images.
+ aespipe program is AES encrypting or decrypting pipe.
+ It reads from standard input and writes to standard
+ output. It can be used to create and restore encrypted
+ tar or cpio archives. It can be used to encrypt and
+ decrypt loop-AES compatible encrypted disk images.
http://koti.tnnet.fi/jari.ruusu/linux/
diff --git a/package/agentpp/Config.in b/package/agentpp/Config.in
index e591fb5..b921585 100644
--- a/package/agentpp/Config.in
+++ b/package/agentpp/Config.in
@@ -5,13 +5,15 @@ config BR2_PACKAGE_AGENTPP
depends on !BR2_STATIC_LIBS # snmp++
select BR2_PACKAGE_SNMPPP
help
- AGENT++ is a set of C++ classes which provides a complete protocol
- engine and dispatch table for the development of SNMP agents.
- AGENT++ is a multilingual API which supports SNMPv1, SNMPv2c, and
- SNMPv3. It provides various C++ classes implementing prototypes for
- scalar and table SNMP managed objects that can be customized by
- derivation. Additional classes support the development of proxy
- agents as well as sending notifications.
+ AGENT++ is a set of C++ classes which provides a
+ complete protocol engine and dispatch table for the
+ development of SNMP agents. AGENT++ is a multilingual
+ API which supports SNMPv1, SNMPv2c, and SNMPv3.
+ It provides various C++ classes implementing prototypes
+ for scalar and table SNMP managed objects that can be
+ customized by derivation. Additional classes support the
+ development of proxy agents as well as sending
+ notifications.
SNMPv3 support is enabled if SNMP++ enables it.
diff --git a/package/alsa-lib/Config.in b/package/alsa-lib/Config.in
index c355b2c..50f7bcc 100644
--- a/package/alsa-lib/Config.in
+++ b/package/alsa-lib/Config.in
@@ -13,8 +13,9 @@ menuconfig BR2_PACKAGE_ALSA_LIB
# is fixed
select BR2_PACKAGE_ALSA_LIB_PCM
help
- The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
- functionality to the Linux operating system.
+ The Advanced Linux Sound Architecture (ALSA) provides
+ audio and MIDI functionality to the Linux operating
+ system.
http://www.alsa-project.org/
diff --git a/package/apache/Config.in b/package/apache/Config.in
index 5916d30..1cf0bc6 100644
--- a/package/apache/Config.in
+++ b/package/apache/Config.in
@@ -6,11 +6,12 @@ config BR2_PACKAGE_APACHE
select BR2_PACKAGE_APR_UTIL
select BR2_PACKAGE_PCRE
help
- The Apache HTTP Server Project is an effort to develop and maintain an
- open-source HTTP server for modern operating systems including UNIX
- and Windows NT. The goal of this project is to provide a secure,
- efficient and extensible server that provides HTTP services in sync
- with the current HTTP standards.
+ The Apache HTTP Server Project is an effort to develop
+ and maintain an open-source HTTP server for modern
+ operating systems including UNIX and Windows NT. The
+ goal of this project is to provide a secure, efficient
+ and extensible server that provides HTTP services in
+ sync with the current HTTP standards.
http://httpd.apache.org
@@ -25,8 +26,8 @@ choice
config BR2_PACKAGE_APACHE_MPM_EVENT
bool "event"
help
- A variant of the worker MPM with the goal of consuming threads
- only for connections with active processing
+ A variant of the worker MPM with the goal of consuming
+ threads only for connections with active processing
config BR2_PACKAGE_APACHE_MPM_PREFORK
bool "prefork"
@@ -36,7 +37,8 @@ config BR2_PACKAGE_APACHE_MPM_PREFORK
config BR2_PACKAGE_APACHE_MPM_WORKER
bool "worker"
help
- Implements a hybrid multi-threaded multi-process web server
+ Implements a hybrid multi-threaded multi-process web
+ server
endchoice
diff --git a/package/apr/Config.in b/package/apr/Config.in
index 5757272..0e09ea6 100644
--- a/package/apr/Config.in
+++ b/package/apr/Config.in
@@ -4,9 +4,10 @@ config BR2_PACKAGE_APR
depends on !BR2_STATIC_LIBS
depends on BR2_USE_MMU # fork() in apr_proc_fork()
help
- The mission of the Apache Portable Runtime (APR) project is to create
- and maintain software libraries that provide a predictable and
- consistent interface to underlying platform-specific implementations
+ The mission of the Apache Portable Runtime (APR) project
+ is to create and maintain software libraries that
+ provide a predictable and consistent interface to
+ underlying platform-specific implementations
http://apr.apache.org/
diff --git a/package/assimp/Config.in b/package/assimp/Config.in
index 93020f7..87870b7 100644
--- a/package/assimp/Config.in
+++ b/package/assimp/Config.in
@@ -7,10 +7,11 @@ config BR2_PACKAGE_ASSIMP
depends on BR2_INSTALL_LIBSTDCPP
select BR2_PACKAGE_ZLIB
help
- Open Asset Import Library (assimp) is a portable Open Source
- library to import various well-known 3D model formats in a uniform
- manner. The most recent version also knows how to export 3d files
- and is therefore suitable as a general-purpose 3D model converter.
+ Open Asset Import Library (assimp) is a portable Open
+ Source library to import various well-known 3D model
+ formats in a uniform manner. The most recent version
+ also knows how to export 3d files and is therefore
+ suitable as a general-purpose 3D model converter.
http://www.assimp.org
diff --git a/package/aubio/Config.in b/package/aubio/Config.in
index c4c60db..515971c 100644
--- a/package/aubio/Config.in
+++ b/package/aubio/Config.in
@@ -3,17 +3,19 @@ config BR2_PACKAGE_AUBIO
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS
help
- aubio is a tool designed for the extraction of annotations from
- audio signals. Its features include segmenting a sound file
- before each of its attacks, performing pitch detection, tapping
- the beat and producing midi streams from live audio.
+ aubio is a tool designed for the extraction of
+ annotations from audio signals. Its features include
+ segmenting a sound file before each of its attacks,
+ performing pitch detection, tapping the beat and
+ producing midi streams from live audio.
- Because these tasks are difficult, we thought it was important
- to gather them in a dedicated library. To increase the fun, we
- have made these algorithms work in a causal way, so as to be
- used in real time applications with as low delay as possible.
- Functions can be used offline in sound editors and software
- samplers, or online in audio effects and virtual instruments.
+ Because these tasks are difficult, we thought it was
+ important to gather them in a dedicated library. To
+ increase the fun, we have made these algorithms work in
+ a causal way, so as to be used in real time applications
+ with as low delay as possible. Functions can be used
+ offline in sound editors and software samplers, or
+ online in audio effects and virtual instruments.
https://aubio.org
diff --git a/package/aufs-util/Config.in b/package/aufs-util/Config.in
index 93999fb..f580bae 100644
--- a/package/aufs-util/Config.in
+++ b/package/aufs-util/Config.in
@@ -21,14 +21,16 @@ config BR2_PACKAGE_AUFS_UTIL_VERSION
string "aufs-util version"
default ""
help
- The version you choose must match that of the aufs support
- in your kernel. Usually, this is aufs3.x for 3.x kernels and
- aufs4.x for 4.x kernels.
+ The version you choose must match that of the aufs
+ support in your kernel. Usually, this is aufs3.x for 3.x
+ kernels and aufs4.x for 4.x kernels.
- Usually, the sha1 of the cset you want to use; avoid using a
- branch name as this yields non-reproducible builds.
+ Usually, the sha1 of the cset you want to use; avoid
+ using a branch name as this yields non-reproducible
+ builds.
- See the following resources to see what versions are available:
+ See the following resources to see what versions are
+ available:
https://sourceforge.net/p/aufs/aufs-util/ci/master/tree/
diff --git a/package/autossh/Config.in b/package/autossh/Config.in
index 6d1a085..98e9ff7 100644
--- a/package/autossh/Config.in
+++ b/package/autossh/Config.in
@@ -3,7 +3,8 @@ config BR2_PACKAGE_AUTOSSH
depends on BR2_USE_MMU # fork()
depends on BR2_PACKAGE_DROPBEAR || BR2_PACKAGE_OPENSSH
help
- autossh is a program to start a copy of ssh and monitor it,
- restarting it as necessary should it die or stop passing traffic.
+ autossh is a program to start a copy of ssh and monitor
+ it, restarting it as necessary should it die or stop
+ passing traffic.
http://www.harding.motd.ca/autossh/
--
2.9.3
^ permalink raw reply related
* [Buildroot] [git commit] lua-resty-http: new package
From: Peter Korsgaard @ 2017-05-05 10:29 UTC (permalink / raw)
To: buildroot
In-Reply-To: <1493935354.76899857@f13.my.com>
>>>>> "semenak94" == semenak94 <semenak94@mail.ru> writes:
> Hello,
> Well, I'm also very far from nginx expert, but yes, it
> lua-nginx-module, which we need in our special embedded linux. So, if
> you don't explicitly have nginx modules in buildroot, how should we
> deal with it?
So how are you using it now?
We currently don't have any explicit handling of the nginx-lua
module. You could conceptually do something with the 'nginx additional
modules' (BR2_PACKAGE_NGINX_ADD_MODULES) option, but there's no
guarantee that nginx builds after luajit.
I guess the proper solution would be to add an explicit nginx-lua
module, similar to what we already have for nginx-dav-ext / nginx-naxsi
/ nginx-upload.
Samuel and Adam, you have added / been active around nginx and modules,
any input?
>> ?> +config BR2_PACKAGE_LUA_RESTY_HTTP
>> ?> + bool "lua-resty-http"
>> ?> + help
>> ?> + ? Lua HTTP client cosocket driver for OpenResty / ngx_lua.
>> ?> +
>> ?> + ? http://github.com/pintsized/lua-resty-http
>> Sorry for the slow response, but this patch apparently never made it to
>> my mailbox? (It is in the archive, so it must have been an issue on my
>> side).
>> I'm far from an expert in nginx, but isn't this an extension to the
>> lua-nginx-module that we don't (explicitly) have in Buildroot? Is it in
>> any way useful without it?
>> What is your use case for it?
--
Bye, Peter Korsgaard
^ permalink raw reply
* [Buildroot] [PATCH v2] lttng-tools: disable on uClibc/musl
From: Thomas Petazzoni @ 2017-05-05 8:47 UTC (permalink / raw)
To: buildroot
In-Reply-To: <1493927478-27096-1-git-send-email-thomas.petazzoni@free-electrons.com>
Hello,
On Thu, 4 May 2017 21:51:18 +0200, Thomas Petazzoni wrote:
> lttng-tools has been broken on uClibc/musl since a long time due to
> dlmopen() and LM_ID_BASE not being implemented. The issue has been
> reported to the upstream lttng developers more than two months ago [1],
> and no fix has been provided. Therefore, it's time to disable it on
> uClibc and musl.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/f9e82a87618bcdcd46d670697b5ac75836f7250d/
> (uclibc)
>
> http://autobuild.buildroot.net/results/cb0952483b580b053a585760e59d78d11f46fc60/
> (musl)
>
> [1] https://lists.lttng.org/pipermail/lttng-dev/2017-February/026921.html
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> Changes since v1:
> - Also disable on musl
> ---
> package/lttng-tools/Config.in | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [PATCH] binutils: disallow selection of 2.27 on ARM/noMMU
From: Thomas Petazzoni @ 2017-05-05 8:47 UTC (permalink / raw)
To: buildroot
In-Reply-To: <1493911717-11921-1-git-send-email-thomas.petazzoni@free-electrons.com>
Hello,
On Thu, 4 May 2017 17:28:37 +0200, Thomas Petazzoni wrote:
> binutils 2.27 triggers a segfault in elf2flt on ARM/noMMU. While Arnout
> has identified a binutils 2.28 commit that can be backported on 2.27,
> this commit is huge and we don't clearly understand the impact.
>
> Since both binutils 2.26 and 2.28 are unaffected by this issue, we
> simply disallow the selection of binutils 2.27 on ARM/noMMU, and default
> to binutils 2.28.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/e14cadb290b0b86cac12c4bfb681eb6eee9e6dea/
> and lots of other similar ARM/Cortex-M4 failures
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> package/binutils/Config.in.host | 3 +++
> 1 file changed, 3 insertions(+)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] lttng-tools: disable on uClibc/musl
From: Thomas Petazzoni @ 2017-05-05 8:46 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=a36f24f79b92558812e24823a951e803cc8689ee
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
lttng-tools has been broken on uClibc/musl since a long time due to
dlmopen() and LM_ID_BASE not being implemented. The issue has been
reported to the upstream lttng developers more than two months ago [1],
and no fix has been provided. Therefore, it's time to disable it on
uClibc and musl.
Fixes:
http://autobuild.buildroot.net/results/f9e82a87618bcdcd46d670697b5ac75836f7250d/
(uclibc)
http://autobuild.buildroot.net/results/cb0952483b580b053a585760e59d78d11f46fc60/
(musl)
[1] https://lists.lttng.org/pipermail/lttng-dev/2017-February/026921.html
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/lttng-tools/Config.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/package/lttng-tools/Config.in b/package/lttng-tools/Config.in
index 187e424..8888ef7 100644
--- a/package/lttng-tools/Config.in
+++ b/package/lttng-tools/Config.in
@@ -4,6 +4,8 @@ config BR2_PACKAGE_LTTNG_TOOLS
depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on !BR2_STATIC_LIBS # uses dlfcn
+ # uclibc/musl don't implement dlmopen()/LM_ID_BASE
+ depends on BR2_TOOLCHAIN_USES_GLIBC
select BR2_PACKAGE_LIBURCU
select BR2_PACKAGE_LIBXML2
select BR2_PACKAGE_POPT
@@ -27,6 +29,7 @@ config BR2_PACKAGE_LTTNG_TOOLS
http://lttng.org
-comment "lttng-tools needs a toolchain w/ threads, dynamic library"
+comment "lttng-tools needs a glibc toolchain w/ threads, dynamic library"
depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
- depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
+ depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
+ !BR2_TOOLCHAIN_USES_GLIBC
^ permalink raw reply related
* [Buildroot] [git commit] binutils: disallow selection of 2.27 on ARM/noMMU
From: Thomas Petazzoni @ 2017-05-05 8:46 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=ee707e5e76d9b8636a2a972761bea0b881e83a7d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
binutils 2.27 triggers a segfault in elf2flt on ARM/noMMU. While Arnout
has identified a binutils 2.28 commit that can be backported on 2.27,
this commit is huge and we don't clearly understand the impact.
Since both binutils 2.26 and 2.28 are unaffected by this issue, we
simply disallow the selection of binutils 2.27 on ARM/noMMU, and default
to binutils 2.28.
Fixes:
http://autobuild.buildroot.net/results/e14cadb290b0b86cac12c4bfb681eb6eee9e6dea/
and lots of other similar ARM/Cortex-M4 failures
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/binutils/Config.in.host | 3 +++
1 file changed, 3 insertions(+)
diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host
index aa24fd7..e147ef0 100644
--- a/package/binutils/Config.in.host
+++ b/package/binutils/Config.in.host
@@ -3,6 +3,7 @@ comment "Binutils Options"
choice
prompt "Binutils Version"
default BR2_BINUTILS_VERSION_2_27_X
+ default BR2_BINUTILS_VERSION_2_28_X if (BR2_arm && !BR2_USE_MMU)
depends on !BR2_arc
help
Select the version of binutils you wish to use.
@@ -12,6 +13,8 @@ config BR2_BINUTILS_VERSION_2_26_X
config BR2_BINUTILS_VERSION_2_27_X
bool "binutils 2.27"
+ # binutils 2.27 triggers a bug in elf2flt on ARM/noMMU
+ depends on !(BR2_arm && !BR2_USE_MMU)
config BR2_BINUTILS_VERSION_2_28_X
bool "binutils 2.28"
^ permalink raw reply related
* [Buildroot] [PATCH v2] lua-resty-http: correct license file path
From: Thomas Petazzoni @ 2017-05-05 8:46 UTC (permalink / raw)
To: buildroot
In-Reply-To: <1493973355-6187-1-git-send-email-rahulbedarkar89@gmail.com>
Hello,
On Fri, 5 May 2017 14:05:55 +0530, Rahul Bedarkar wrote:
> LICENSE file is present in subdirectory.
>
> Fixes:
> http://autobuild.buildroot.net/results/d33/d33a322b4d2618b55849b5637082100702a91eea
>
> Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
> ---
> v2:
> - Add link to Buildroot autobuild failure
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] lua-resty-http: correct license file path
From: Thomas Petazzoni @ 2017-05-05 8:46 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=6d711c5868a4a890ef16df9f4ae6705a3abf7ca6
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
LICENSE file is present in subdirectory.
Fixes:
http://autobuild.buildroot.net/results/d33/d33a322b4d2618b55849b5637082100702a91eea
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/lua-resty-http/lua-resty-http.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/lua-resty-http/lua-resty-http.mk b/package/lua-resty-http/lua-resty-http.mk
index 927fdae..7ab8b0e 100644
--- a/package/lua-resty-http/lua-resty-http.mk
+++ b/package/lua-resty-http/lua-resty-http.mk
@@ -7,6 +7,6 @@
LUA_RESTY_HTTP_VERSION = 0.10-0
LUA_RESTY_HTTP_SUBDIR = lua-resty-http
LUA_RESTY_HTTP_LICENSE = BSD-2-Clause
-LUA_RESTY_HTTP_LICENSE_FILES = LICENSE
+LUA_RESTY_HTTP_LICENSE_FILES = $(LUA_RESTY_HTTP_SUBDIR)/LICENSE
$(eval $(luarocks-package))
^ permalink raw reply related
* [Buildroot] invalid commads passed in compiler line results in failure.
From: Thomas Petazzoni @ 2017-05-05 8:45 UTC (permalink / raw)
To: buildroot
In-Reply-To: <trinity-c9000ae1-4900-4b9d-b1b4-48dcecd9c904-1493971657439@3capp-mailcom-bs14>
Hello,
On Fri, 5 May 2017 10:07:37 +0200, daggs wrote:
> I'm trying to add a new pkg what compile a kernel driver for arm, upon compilation, I get these errors:
> aarch64-linux-gcc.br_real: error: unrecognized argument in option ?-mabi=apcs-gnu?
> aarch64-linux-gcc.br_real: note: valid arguments to ?-mabi=? are: ilp32 lp64
> aarch64-linux-gcc.br_real: error: unrecognized command line option ?-mapcs?; did you mean ?--specs??
> aarch64-linux-gcc.br_real: error: unrecognized command line option ?-mno-sched-prolog?; did you mean ?-Wno-sign-promo??
> aarch64-linux-gcc.br_real: error: unrecognized command line option ?-msoft-float?
You are passing ARM options to an AArch64 compiler: this cannot work.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] qemu: fix user mode emulation build on ARM
From: Thomas Petazzoni @ 2017-05-05 8:43 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=40c5fff46629ac4f0f55165f9c3594980a4700ef
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
This commit adds a patch that adjusts how the mcontext structure is used
on ARM with a uClibc C library.
Fixes:
http://autobuild.buildroot.net/results/79900b22c190e883b6d9a3075e1286ec95840ae1/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch b/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
new file mode 100644
index 0000000..6d6d024
--- /dev/null
+++ b/package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
@@ -0,0 +1,35 @@
+From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 5 May 2017 09:07:15 +0200
+Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc
+
+user-exec.c has some conditional code to decide how to use the
+mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but
+with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path
+gets used, which doesn't apply to uClibc.
+
+Fix this by excluding __UCLIBC__, which ensures we fall back to the
+general case of using uc_mcontext.arm_pc, which works fine with
+uClibc.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ user-exec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/user-exec.c b/user-exec.c
+index 6db0758..2b3d116 100644
+--- a/user-exec.c
++++ b/user-exec.c
+@@ -409,7 +409,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+
+ #if defined(__NetBSD__)
+ pc = uc->uc_mcontext.__gregs[_REG_R15];
+-#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
++#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
+ pc = uc->uc_mcontext.gregs[R15];
+ #else
+ pc = uc->uc_mcontext.arm_pc;
+--
+2.7.4
+
^ permalink raw reply related
* [Buildroot] [PATCH v2] lua-resty-http: correct license file path
From: Rahul Bedarkar @ 2017-05-05 8:35 UTC (permalink / raw)
To: buildroot
LICENSE file is present in subdirectory.
Fixes:
http://autobuild.buildroot.net/results/d33/d33a322b4d2618b55849b5637082100702a91eea
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
---
v2:
- Add link to Buildroot autobuild failure
package/lua-resty-http/lua-resty-http.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/lua-resty-http/lua-resty-http.mk b/package/lua-resty-http/lua-resty-http.mk
index 927fdae..7ab8b0e 100644
--- a/package/lua-resty-http/lua-resty-http.mk
+++ b/package/lua-resty-http/lua-resty-http.mk
@@ -7,6 +7,6 @@
LUA_RESTY_HTTP_VERSION = 0.10-0
LUA_RESTY_HTTP_SUBDIR = lua-resty-http
LUA_RESTY_HTTP_LICENSE = BSD-2-Clause
-LUA_RESTY_HTTP_LICENSE_FILES = LICENSE
+LUA_RESTY_HTTP_LICENSE_FILES = $(LUA_RESTY_HTTP_SUBDIR)/LICENSE
$(eval $(luarocks-package))
--
2.7.4
^ permalink raw reply related
* [Buildroot] [PATCH] lua-resty-http: correct license file path
From: Rahul Bedarkar @ 2017-05-05 8:31 UTC (permalink / raw)
To: buildroot
LICENSE file is present in subdirectory.
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
---
package/lua-resty-http/lua-resty-http.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/lua-resty-http/lua-resty-http.mk b/package/lua-resty-http/lua-resty-http.mk
index 927fdae..7ab8b0e 100644
--- a/package/lua-resty-http/lua-resty-http.mk
+++ b/package/lua-resty-http/lua-resty-http.mk
@@ -7,6 +7,6 @@
LUA_RESTY_HTTP_VERSION = 0.10-0
LUA_RESTY_HTTP_SUBDIR = lua-resty-http
LUA_RESTY_HTTP_LICENSE = BSD-2-Clause
-LUA_RESTY_HTTP_LICENSE_FILES = LICENSE
+LUA_RESTY_HTTP_LICENSE_FILES = $(LUA_RESTY_HTTP_SUBDIR)/LICENSE
$(eval $(luarocks-package))
--
2.7.4
^ permalink raw reply related
* [Buildroot] invalid commads passed in compiler line results in failure.
From: daggs @ 2017-05-05 8:07 UTC (permalink / raw)
To: buildroot
Greetings,
I'm trying to add a new pkg what compile a kernel driver for arm, upon compilation, I get these errors:
aarch64-linux-gcc.br_real: error: unrecognized argument in option ?-mabi=apcs-gnu?
aarch64-linux-gcc.br_real: note: valid arguments to ?-mabi=? are: ilp32 lp64
aarch64-linux-gcc.br_real: error: unrecognized command line option ?-mapcs?; did you mean ?--specs??
aarch64-linux-gcc.br_real: error: unrecognized command line option ?-mno-sched-prolog?; did you mean ?-Wno-sign-promo??
aarch64-linux-gcc.br_real: error: unrecognized command line option ?-msoft-float?
asking google suggests that I'm not setting the CROSS_COMPILE var properly but from what I see, there are no problems.
the line I'm using in the mk file is this:
$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)/driver/src/devicedrv/mali/ $(TARGET_CONFIGURE_OPTS)
the entire compilation line is this:
/home/dagg/workspace/buildroots/buildroot-master4/output/host/usr/bin/aarch64-linux-gcc -Wp,-MD,/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/linux/.mali_osk_atomics.o.d -nostdinc -isystem /home/dagg/workspace/buildroots/buildroot-master4/output/host/usr/lib/gcc/aarch64-buildroot-linux-gnu/6.3.0/include -I./arch/arm/include -I./arch/arm/include/generated/uapi -I./arch/arm/include/generated -I./include -I./arch/arm/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-alpine/include -Iarch/arm/mach-berlin/include -Iarch/arm/mach-exynos/include -Iarch/arm/mach-hisi/include -Iarch/arm/mach-meson/include -Iarch/arm/mach-mvebu/include -Iarch/arm/mach-mediatek/include -Iarch/arm/mach-qcom/include -Iarch/arm/mach-rockchip/include -Iarch/arm/mach-shmobile/include -Iarch/arm/mach-sunxi/include -Iarch/arm/mach-tegra/include -Iarch/arm/mach-uniphier/include -Iarch/arm/mach-vexpress/include -Iarch/arm/mach-zx/include -Iarch/arm/plat-samsung/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -msoft-float -Uarm -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/linux/license/gpl -DCONFIG_MALI400=1 -DCONFIG_MALI450=1 -DCONFIG_MALI470=1 -DMALI_FAKE_PLATFORM_DEVICE=1 -DCONFIG_MALI_DMA_BUF_MAP_ON_ATTACH -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=0 -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=0 -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=0 -DMALI_STATE_TRACKING=1 -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 -DUSING_GPU_UTILIZATION=0 -DMALI_ENABLE_CPU_CYCLES=0 -DMALI_UPPER_HALF_SCHEDULING -DDEBUG -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/include -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/common -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/linux -I/home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/platform -Wno-date-time '-DSVN_REV_STRING="r6p1-01rel0"' -DMODULE '-DKBUILD_BASENAME="mali_osk_atomics"' '-DKBUILD_MODNAME="mali"' -c -o /home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/linux/mali_osk_atomics.o /home/dagg/workspace/buildroots/meson_gx_mali_450-0d146fd1fa6b162ff2a2ed2dd17d291622aeec70/driver/src/devicedrv/mali/linux/mali_osk_atomics.c
any ideas what can be the issue?
Thanks,
Dagg.
^ permalink raw reply
* [Buildroot] [autobuild.buildroot.net] Build results for 2017-05-04
From: Thomas Petazzoni @ 2017-05-05 6:28 UTC (permalink / raw)
To: buildroot
Hello,
Build statistics for 2017-05-04
================================
successes : 188
failures : 79
timeouts : 0
TOTAL : 267
Classification of failures by reason
====================================
host-protobuf-3.2.0 | 20
libqmi-1.18.0 | 7
luvi-v2.7.5 | 5
radvd-2.12 | 4
tinyxml2-4.0.1 | 4
binutils-2.27 | 3
busybox-1.26.2 | 3
uboot-tools-2017.03 | 3
atest-895b0183a89c15f5e2305... | 2
lttng-tools-2.9.4 | 2
poppler-0.54.0 | 2
protobuf-3.2.0 | 2
qt-4.8.7 | 2
rapidjson-v1.1.0 | 2
apache-legal-info | 1
arp-scan-1.9 | 1
atftp-0.7.1 | 1
host-ti-cgt-pru-2.1.4 | 1
kvm-unit-tests-5731572b2ac2... | 1
libselinux-2.6 | 1
libxml2-2.9.4 | 1
lvm2-2.02.170 | 1
madplay-0.15.2b | 1
mpir-3.0.0 | 1
mplayer-1.3.0 | 1
mpv-0.25.0 | 1
nodejs-7.9.0 | 1
openblas-f04af36ad0e85b64f1... | 1
qemu-2.8.0 | 1
qt5declarative-5.8.0 | 1
toolchain-external-custom | 1
toolchain-external-custom-l... | 1
Detail of failures
===================
arm | apache-legal-info | NOK | http://autobuild.buildroot.net/results/2564362d01139ca3bf3caa30509ae1c8c21239ef |
arm | arp-scan-1.9 | NOK | http://autobuild.buildroot.net/results/e14cadb290b0b86cac12c4bfb681eb6eee9e6dea |
microblazeel | atest-895b0183a89c15f5e2305... | NOK | http://autobuild.buildroot.net/results/40743aff7e36f21625f2a8bb42d277f79ac1e0a7 |
arc | atest-895b0183a89c15f5e2305... | NOK | http://autobuild.buildroot.net/results/b2977977d9484d861e6955677032bd929592e8ba |
arm | atftp-0.7.1 | NOK | http://autobuild.buildroot.net/results/c2b4d30eb4b619322088161774d9fc66beccda64 |
bfin | binutils-2.27 | NOK | http://autobuild.buildroot.net/results/b7e43a1cdcae5c5c177c35b5275c5b120fda5fa3 | ORPH
bfin | binutils-2.27 | NOK | http://autobuild.buildroot.net/results/31f73933a332fb613bbfde78735ed07707b2a83c | ORPH
bfin | binutils-2.27 | NOK | http://autobuild.buildroot.net/results/72f477e1ed17b70cfe05018d5140bfc71a3747ce | ORPH
arm | busybox-1.26.2 | NOK | http://autobuild.buildroot.net/results/5296e9dccd5023d682d4cd763f15dc08609658d7 | ORPH
arm | busybox-1.26.2 | NOK | http://autobuild.buildroot.net/results/fabece97746c622b1b852fbf17453682c99c5dd8 | ORPH
arm | busybox-1.26.2 | NOK | http://autobuild.buildroot.net/results/477573158f2d9738d2fe11f84d0b72f456541b9a | ORPH
mips | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/5eab7fb2e78c2bcab9e2f4d9b57c044fb2df0f14 | ORPH
mips64el | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/d7b17f0c31dd39a9fc46284c162dffcfc7a5dc44 | ORPH
sparc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/f02e66b3c094b2c5136484f8c28585c7d4a60a40 | ORPH
powerpc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/6d8ec7d169c58be5d826e8dd3366752d1b5124e1 | ORPH
mipsel | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/e7c9eb6ac3fe477312c53564ee114d912adb83db | ORPH
arm | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/fa7d3e77f4ac0aaee93eb3a31db07a4c5597985a | ORPH
sh4a | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/c64dd245d12ffecf6465d2f6a3817d7e921bd467 | ORPH
powerpc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/8e615bf5becd6489320ab376abaa0576fbe0baff | ORPH
mips64el | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/9fa46ae09dcf0932803e7c52c87d2ebb56c27898 | ORPH
arm | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/23d717bf592f6574137d4e0b20abc830b58a0284 | ORPH
arc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/1c4de1fbd19243165142086f1691a9d54101661b | ORPH
nios2 | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/82c1b525ac0449806bd20f6016f6be4fe2bb82fa | ORPH
powerpc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/d829d8150c977f7b245ef28f0ea0c4b0b3791e03 | ORPH
or1k | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/6580201099de318dbb8dc5fb9eed0ed7f941e8b9 | ORPH
x86_64 | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/9fd1d166cd44eecef54aff1c32ec9b1bc98f8270 | ORPH
i686 | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/1017a7f44c955c7113266c3f45c8a5106345e0b2 | ORPH
sparc | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/bd6cedaa97db38dddb0a54e81d611bd52694fed6 | ORPH
sh4 | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/0491b8ffc8c580c191e421567982851e3269d557 | ORPH
m68k | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/eb3ed1638dfd2fb13eff65cff31982c8388a5f29 | ORPH
or1k | host-protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/7df6b3bbf57d0a695d7c158387bbaa20aa579bab | ORPH
arm | host-ti-cgt-pru-2.1.4 | NOK | http://autobuild.buildroot.net/results/01fccc880ae53a60e03eb1bf8236d5c02c28dada |
x86_64 | kvm-unit-tests-5731572b2ac2... | NOK | http://autobuild.buildroot.net/results/68c2fb80a57ed5a7b5ba2cddd91aaf7afcc3476b |
arm | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/f92c7cbb26ee25ba709a2a6b0738189b835d4322 | ORPH
mipsel | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/b7ded5f81093790ea528738bc3734503576d1cb2 | ORPH
nios2 | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/02b3f6bcb2743f529204160e5f1af95a7cf0ba51 | ORPH
arm | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/8ca091e02cdbcea1541e8c3d58372cec17705ade | ORPH
x86_64 | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/c18967f936310680ed91e8dac6476a026d92dddc | ORPH
x86_64 | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/f6e7a44a56270ebd869ac1e7f78b563c908c7b70 | ORPH
mipsel | libqmi-1.18.0 | NOK | http://autobuild.buildroot.net/results/4f0eb2af09c92ff4cd7448211ffda432754d4e60 | ORPH
mips64el | libselinux-2.6 | NOK | http://autobuild.buildroot.net/results/98df2219b99c74f63d214dee5feb77925932f17d |
arm | libxml2-2.9.4 | NOK | http://autobuild.buildroot.net/results/87093eb13d0396dc88f60386b2e1169b681f8f98 | ORPH
arm | lttng-tools-2.9.4 | NOK | http://autobuild.buildroot.net/results/f9e82a87618bcdcd46d670697b5ac75836f7250d |
x86_64 | lttng-tools-2.9.4 | NOK | http://autobuild.buildroot.net/results/cb0952483b580b053a585760e59d78d11f46fc60 |
i686 | luvi-v2.7.5 | NOK | http://autobuild.buildroot.net/results/440e3b9fc22e508f413caa0f70d2dcd1f46b3d0d |
arm | luvi-v2.7.5 | NOK | http://autobuild.buildroot.net/results/3eef12dbe07fb375e87b2b2898dcc5ef0c11e7a5 |
powerpc | luvi-v2.7.5 | NOK | http://autobuild.buildroot.net/results/04bb96c527ecd062307b2c584da5a0654e26582b |
i686 | luvi-v2.7.5 | NOK | http://autobuild.buildroot.net/results/ca41ced46684b8e982fe4480755d205b922b5cb3 |
i586 | luvi-v2.7.5 | NOK | http://autobuild.buildroot.net/results/872e41cc58a73e0c6152d98eefe0850c6b18f114 |
arc | lvm2-2.02.170 | NOK | http://autobuild.buildroot.net/results/259b18181df2af5228707677879c5aeb42e5a36e | ORPH
powerpc | madplay-0.15.2b | NOK | http://autobuild.buildroot.net/results/9624003b0528d33a66f28c6e9dcd48d9bc887363 | ORPH
mips64el | mpir-3.0.0 | NOK | http://autobuild.buildroot.net/results/f62c6014a48970f97d718a8698009847ae4b4889 |
i686 | mplayer-1.3.0 | NOK | http://autobuild.buildroot.net/results/3fa5b5af77d10e4576cda3a38cb418024aa58e22 |
mipsel | mpv-0.25.0 | NOK | http://autobuild.buildroot.net/results/8fb9306200c7f49afb077e3745b11cb65d8bc9ec |
x86_64 | nodejs-7.9.0 | NOK | http://autobuild.buildroot.net/results/0e4fb1a615ab9654ad2b4b1274a34583e02aa44e |
sparc | openblas-f04af36ad0e85b64f1... | NOK | http://autobuild.buildroot.net/results/01b7e6157d891905e6cd18a29651688eb0c78fc7 |
arm | poppler-0.54.0 | NOK | http://autobuild.buildroot.net/results/b749b252f63945f278358dcd76b6e9c55214ccd8 |
i686 | poppler-0.54.0 | NOK | http://autobuild.buildroot.net/results/92e68defe746eb4852b3a45bb27af2282d3f4c7e |
sparc | protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/c6e29c120900cbbc54c1c7fde48217609375dabc | ORPH
sparc | protobuf-3.2.0 | NOK | http://autobuild.buildroot.net/results/61089d8e6651054fa1ed60aad4dbfde5535cda01 | ORPH
arm | qemu-2.8.0 | NOK | http://autobuild.buildroot.net/results/79900b22c190e883b6d9a3075e1286ec95840ae1 |
or1k | qt-4.8.7 | NOK | http://autobuild.buildroot.net/results/b42dcc8f27a1dd5a77224c1603a1e45605e851af | ORPH
or1k | qt-4.8.7 | NOK | http://autobuild.buildroot.net/results/4ba65792c2bfe75f3c7a57e1dfa7162969e7b2ba | ORPH
arm | qt5declarative-5.8.0 | NOK | http://autobuild.buildroot.net/results/64a198397736db12b73c1f693dbe1c47d73b53da |
microblazeel | radvd-2.12 | NOK | http://autobuild.buildroot.net/results/e25627bdad5caeca653481c18a172f498d32c36f | ORPH
arc | radvd-2.12 | NOK | http://autobuild.buildroot.net/results/73170906b5b42ff14c3e444aef0d34fa86729afa | ORPH
arm | radvd-2.12 | NOK | http://autobuild.buildroot.net/results/c9048915eccd4be0b2ed709999f53d697bf66900 | ORPH
xtensa | radvd-2.12 | NOK | http://autobuild.buildroot.net/results/7efbf3508cb4b02b510066be806778317539db75 | ORPH
microblazeel | rapidjson-v1.1.0 | NOK | http://autobuild.buildroot.net/results/c69b791f944610438daaaa53e1030fe8c78ea3c0 |
arm | rapidjson-v1.1.0 | NOK | http://autobuild.buildroot.net/results/ac989c119e4ea90b8318795fe9cf8c3e9395a354 |
arm | tinyxml2-4.0.1 | NOK | http://autobuild.buildroot.net/results/5fb0ec2d93fdaa6cb47807488c5db45a67a50b91 |
m68k | tinyxml2-4.0.1 | NOK | http://autobuild.buildroot.net/results/c5922dd689fccf74d128f597609418eb43ffebec |
m68k | tinyxml2-4.0.1 | NOK | http://autobuild.buildroot.net/results/0247ce0474fb5df8913f8ff12028d992e408964d |
arm | tinyxml2-4.0.1 | NOK | http://autobuild.buildroot.net/results/23394eea5f8ef5a1e7993ee84902b37b463ba091 |
arm | toolchain-external-custom | NOK | http://autobuild.buildroot.net/results/de2da398744b5e2b4ba88641c9ee99426e6f2f28 |
x86_64 | toolchain-external-custom-l... | NOK | http://autobuild.buildroot.net/results/5890a96c4f8324839981ce950241b1c442e80827 | ORPH
nios2 | uboot-tools-2017.03 | NOK | http://autobuild.buildroot.net/results/75e0655935f438a3d483ee02e8cbc764c48d6652 | ORPH
mipsel | uboot-tools-2017.03 | NOK | http://autobuild.buildroot.net/results/fb609f6b55cebfd9a970d1253c07a62e883f5984 | ORPH
mips64el | uboot-tools-2017.03 | NOK | http://autobuild.buildroot.net/results/082f2e93ae7f4ff23167e89eda9fa0db6cb8185b | ORPH
--
http://autobuild.buildroot.net
^ permalink raw reply
* [Buildroot] [git commit] lua-resty-http: new package
From: semenak94 at mail.ru @ 2017-05-04 22:02 UTC (permalink / raw)
To: buildroot
Hello,
Well, I'm also very far from nginx expert, but yes, it lua-nginx-module, which we need in our special embedded linux. So, if you don't explicitly have nginx modules in buildroot, how should we deal with it?
--
Semyon
-----------
Semyon Kolganov
???????, 05 ??? 2017?., 00:02 +03:00 ?? Peter Korsgaard peter at korsgaard.com:
>>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>?> commit: https://git.buildroot.net/buildroot/commit/?id=e88995f065986dc56ce5a7c222f7a9f6cbff2b94
>?> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>?> Signed-off-by: Semyon Kolganov <semenak94@mail.ru>
>?> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>?> ---
>?>? DEVELOPERS???????????????????????????????? |? 1 +
>?>? package/Config.in????????????????????????? |? 1 +
>?>? package/lua-resty-http/Config.in?????????? |? 6 ++++++
>?>? package/lua-resty-http/lua-resty-http.hash |? 2 ++
>?>? package/lua-resty-http/lua-resty-http.mk?? | 12 ++++++++++++
>?>? 5 files changed, 22 insertions(+)
>?> +++ b/package/lua-resty-http/Config.in
>?> @@ -0,0 +1,6 @@
>?> +config BR2_PACKAGE_LUA_RESTY_HTTP
>?> + bool "lua-resty-http"
>?> + help
>?> + ? Lua HTTP client cosocket driver for OpenResty / ngx_lua.
>?> +
>?> + ? http://github.com/pintsized/lua-resty-http
>Sorry for the slow response, but this patch apparently never made it to
>my mailbox? (It is in the archive, so it must have been an issue on my
>side).
>I'm far from an expert in nginx, but isn't this an extension to the
>lua-nginx-module that we don't (explicitly) have in Buildroot? Is it in
>any way useful without it?
>What is your use case for it?
>--
>Bye, Peter Korsgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170505/ce29f82e/attachment.html>
^ permalink raw reply
* [Buildroot] [PATCH] package/opencv3: fix build for x86_64 target
From: Samuel Martin @ 2017-05-04 21:53 UTC (permalink / raw)
To: buildroot
This change backports a fix from upstream fixing missing symbols due to
wrong compiler optimization flags.
On Buildroot side, also remove deprecated options passed on the
configure command.
Fixes:
http://autobuild.buildroot.net/results/af9/af950c6172a578c4eeeb9440b6990ceb48263fa6/build-end.log
http://autobuild.buildroot.net/results/e88/e8832302cd4f30cec076f67965f6aacbaca5b955/build-end.log
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
.../0001-cmake-support-multiple-CPU-targets.patch | 2501 ++++++++++++++++++++
package/opencv3/opencv3.mk | 16 +-
2 files changed, 2502 insertions(+), 15 deletions(-)
create mode 100644 package/opencv3/0001-cmake-support-multiple-CPU-targets.patch
diff --git a/package/opencv3/0001-cmake-support-multiple-CPU-targets.patch b/package/opencv3/0001-cmake-support-multiple-CPU-targets.patch
new file mode 100644
index 000000000..5df5b007e
--- /dev/null
+++ b/package/opencv3/0001-cmake-support-multiple-CPU-targets.patch
@@ -0,0 +1,2501 @@
+Backported from: https://github.com/opencv/opencv/pull/7462/commits/e16227b53cabab1caa4b7aba8ff59a630528348f
+Reference: https://github.com/opencv/opencv/issues/7985
+
+From 5628a02177eec7adac1fcaf30634a6d6e17bb15d Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@intel.com>
+Date: Wed, 7 Sep 2016 18:02:36 +0300
+Subject: [PATCH] cmake: support multiple CPU targets
+
+(cherry picked from commit e16227b53cabab1caa4b7aba8ff59a630528348f)
+---
+ CMakeLists.txt | 50 +-
+ cmake/OpenCVCompilerOptimizations.cmake | 651 +++++++++++++++++++++
+ cmake/OpenCVCompilerOptions.cmake | 161 +----
+ cmake/OpenCVGenHeaders.cmake | 4 +
+ cmake/OpenCVModule.cmake | 3 +
+ cmake/OpenCVPCHSupport.cmake | 5 +-
+ cmake/OpenCVUtils.cmake | 50 +-
+ cmake/checks/cpu_avx.cpp | 9 +
+ cmake/checks/cpu_avx2.cpp | 10 +
+ cmake/checks/cpu_avx512.cpp | 10 +
+ cmake/checks/{fp16.cpp => cpu_fp16.cpp} | 2 +-
+ cmake/checks/cpu_popcnt.cpp | 8 +
+ cmake/checks/cpu_sse.cpp | 2 +
+ cmake/checks/cpu_sse2.cpp | 2 +
+ cmake/checks/cpu_sse3.cpp | 7 +
+ cmake/checks/cpu_sse41.cpp | 6 +
+ cmake/checks/cpu_sse42.cpp | 5 +
+ cmake/checks/cpu_ssse3.cpp | 7 +
+ cmake/templates/cv_cpu_config.h.in | 5 +
+ cmake/templates/cvconfig.h.in | 13 +
+ .../core/include/opencv2/core/cv_cpu_dispatch.h | 166 ++++++
+ modules/core/include/opencv2/core/cv_cpu_helper.h | 133 +++++
+ modules/core/include/opencv2/core/cvdef.h | 145 +----
+ modules/core/include/opencv2/core/fast_math.hpp | 60 +-
+ modules/core/src/system.cpp | 301 ++++++++--
+ modules/highgui/CMakeLists.txt | 2 +-
+ modules/imgproc/src/imgwarp.cpp | 4 +-
+ modules/objdetect/src/haar.cpp | 5 +-
+ 28 files changed, 1440 insertions(+), 386 deletions(-)
+ create mode 100644 cmake/OpenCVCompilerOptimizations.cmake
+ create mode 100644 cmake/checks/cpu_avx.cpp
+ create mode 100644 cmake/checks/cpu_avx2.cpp
+ create mode 100644 cmake/checks/cpu_avx512.cpp
+ rename cmake/checks/{fp16.cpp => cpu_fp16.cpp} (86%)
+ create mode 100644 cmake/checks/cpu_popcnt.cpp
+ create mode 100644 cmake/checks/cpu_sse.cpp
+ create mode 100644 cmake/checks/cpu_sse2.cpp
+ create mode 100644 cmake/checks/cpu_sse3.cpp
+ create mode 100644 cmake/checks/cpu_sse41.cpp
+ create mode 100644 cmake/checks/cpu_sse42.cpp
+ create mode 100644 cmake/checks/cpu_ssse3.cpp
+ create mode 100644 cmake/templates/cv_cpu_config.h.in
+ create mode 100644 modules/core/include/opencv2/core/cv_cpu_dispatch.h
+ create mode 100644 modules/core/include/opencv2/core/cv_cpu_helper.h
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cc45f6f39..9c9971ec0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -85,6 +85,10 @@ if(POLICY CMP0042)
+ cmake_policy(SET CMP0042 NEW)
+ endif()
+
++if(POLICY CMP0051)
++ cmake_policy(SET CMP0051 NEW)
++endif()
++
+ include(cmake/OpenCVUtils.cmake)
+
+ # must go before the project command
+@@ -274,16 +278,6 @@ OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov"
+ OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
+ OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
+ OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSE "Enable SSE instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSE2 "Enable SSE2 instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions" ON IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_POPCNT "Enable POPCNT instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+-OCV_OPTION(ENABLE_FMA3 "Enable FMA3 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
+ OCV_OPTION(ENABLE_NEON "Enable NEON instructions" "${NEON}" IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64 OR IOS) )
+ OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64 OR IOS) )
+ OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
+@@ -292,6 +286,9 @@ OCV_OPTION(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with n
+ OCV_OPTION(ENABLE_IMPL_COLLECTION "Collect implementation data on function call" OFF )
+ OCV_OPTION(ENABLE_INSTRUMENTATION "Instrument functions to collect calls trace and performance" OFF )
+ OCV_OPTION(GENERATE_ABI_DESCRIPTOR "Generate XML file for abi_compliance_checker tool" OFF IF UNIX)
++OCV_OPTION(CV_ENABLE_INTRINSICS "Use intrinsic-based optimized code" ON )
++OCV_OPTION(CV_DISABLE_OPTIMIZATION "Disable explicit optimized code (dispatched code/intrinsics/loop unrolling/etc)" OFF )
++
+
+ OCV_OPTION(DOWNLOAD_EXTERNAL_TEST_DATA "Download external test data (Python executable and OPENCV_TEST_DATA_PATH environment variable may be required)" OFF )
+
+@@ -492,6 +489,9 @@ if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL
+ set(CMAKE_BUILD_TYPE Release)
+ endif()
+
++# --- Python Support ---
++include(cmake/OpenCVDetectPython.cmake)
++
+ include(cmake/OpenCVCompilerOptions.cmake)
+
+
+@@ -569,9 +569,6 @@ else()
+ unset(DOXYGEN_FOUND CACHE)
+ endif()
+
+-# --- Python Support ---
+-include(cmake/OpenCVDetectPython.cmake)
+-
+ # --- Java Support ---
+ include(cmake/OpenCVDetectApacheAnt.cmake)
+ if(ANDROID)
+@@ -860,6 +857,33 @@ if(NOT CMAKE_GENERATOR MATCHES "Xcode|Visual Studio")
+ status(" Configuration:" ${CMAKE_BUILD_TYPE})
+ endif()
+
++
++# ========================= CPU code generation mode =========================
++status("")
++status(" CPU/HW features:")
++status(" Baseline:" "${CPU_BASELINE_FINAL}")
++if(NOT CPU_BASELINE STREQUAL CPU_BASELINE_FINAL)
++ status(" requested:" "${CPU_BASELINE}")
++endif()
++if(CPU_BASELINE_REQUIRE)
++ status(" required:" "${CPU_BASELINE_REQUIRE}")
++endif()
++if(CPU_BASELINE_DISABLE)
++ status(" disabled:" "${CPU_BASELINE_DISABLE}")
++endif()
++if(CPU_DISPATCH_FINAL OR CPU_DISPATCH)
++ status(" Dispatched code generation:" "${CPU_DISPATCH_FINAL}")
++ if(NOT CPU_DISPATCH STREQUAL CPU_DISPATCH_FINAL)
++ status(" requested:" "${CPU_DISPATCH}")
++ endif()
++ if(CPU_DISPATCH_REQUIRE)
++ status(" required:" "${CPU_DISPATCH_REQUIRE}")
++ endif()
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ status(" ${OPT} (${CPU_${OPT}_USAGE_COUNT} files):" "+ ${CPU_DISPATCH_${OPT}_INCLUDED}")
++ endforeach()
++endif()
++
+ # ========================== C/C++ options ==========================
+ if(CMAKE_CXX_COMPILER_VERSION)
+ set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_CXX_COMPILER_VERSION})")
+diff --git a/cmake/OpenCVCompilerOptimizations.cmake b/cmake/OpenCVCompilerOptimizations.cmake
+new file mode 100644
+index 000000000..b849f02b1
+--- /dev/null
++++ b/cmake/OpenCVCompilerOptimizations.cmake
+@@ -0,0 +1,651 @@
++# x86/x86-64 arch:
++# SSE / SSE2 (always available on 64-bit CPUs)
++# SSE3 / SSSE3
++# SSE4_1 / SSE4_2 / POPCNT
++# AVX / AVX2 / AVX512
++# FMA3
++
++# CPU_{opt}_SUPPORTED=ON/OFF - compiler support (possibly with additional flag)
++# CPU_{opt}_IMPLIES=<list>
++# CPU_{opt}_FORCE=<list> - subset of "implies" list
++# CPU_{opt}_FLAGS_ON=""
++# CPU_{opt}_FEATURE_ALIAS - mapping to CV_CPU_* HWFeature enum
++
++# Input variables:
++# CPU_BASELINE=<list> - preferred list of baseline optimizations
++# CPU_DISPATCH=<list> - preferred list of dispatched optimizations
++
++# Advanced input variables:
++# CPU_BASELINE_REQUIRE=<list> - list of required baseline optimizations
++# CPU_DISPATCH_REQUIRE=<list> - list of required dispatched optimizations
++# CPU_BASELINE_DISABLE=<list> - list of disabled baseline optimizations
++
++# Output variables:
++# CPU_BASELINE_FINAL=<list> - final list of enabled compiler optimizations
++# CPU_DISPATCH_FINAL=<list> - final list of dispatched optimizations
++#
++# CPU_DISPATCH_FLAGS_${opt} - flags for source files compiled separately (_opt_avx2.cpp)
++
++set(CPU_ALL_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3") # without AVX512
++list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16)
++list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
++
++ocv_update(CPU_VFPV3_FEATURE_ALIAS "")
++
++
++set(HELP_CPU_BASELINE "Specify list of enabled baseline CPU optimizations")
++set(HELP_CPU_BASELINE_REQUIRE "Specify list of required baseline CPU optimizations")
++set(HELP_CPU_BASELINE_DISABLE "Specify list of forbidden baseline CPU optimizations")
++set(HELP_CPU_DISPATCH "Specify list of dispatched CPU optimizations")
++set(HELP_CPU_DISPATCH_REQUIRE "Specify list of required dispatched CPU optimizations")
++
++foreach(var CPU_BASELINE CPU_BASELINE_REQUIRE CPU_BASELINE_DISABLE CPU_DISPATCH CPU_DISPATCH_REQUIRE)
++ if(DEFINED ${var})
++ string(REPLACE "," ";" _list "${${var}}")
++ set(${var} "${_list}" CACHE STRING "${HELP_${var}}" FORCE)
++ endif()
++endforeach()
++
++# process legacy flags
++macro(ocv_optimization_process_obsolete_option legacy_flag OPT legacy_warn)
++ if(DEFINED ${legacy_flag})
++ if(${legacy_warn})
++ message(STATUS "WARNING: Option ${legacy_flag}='${${legacy_flag}}' is deprecated and should not be used anymore")
++ message(STATUS " Behaviour of this option is not backward compatible")
++ message(STATUS " Refer to 'CPU_BASELINE'/'CPU_DISPATCH' CMake options documentation")
++ endif()
++ if(${legacy_flag})
++ if(NOT ";${CPU_BASELINE_REQUIRE};" MATCHES ";${OPT};")
++ set(CPU_BASELINE_REQUIRE "${CPU_BASELINE_REQUIRE};${OPT}" CACHE STRING "${HELP_CPU_BASELINE_REQUIRE}" FORCE)
++ endif()
++ else()
++ if(NOT ";${CPU_BASELINE_DISABLE};" MATCHES ";${OPT};")
++ set(CPU_BASELINE_DISABLE "${CPU_BASELINE_DISABLE};${OPT}" CACHE STRING "${HELP_CPU_BASELINE_DISABLE}" FORCE)
++ endif()
++ endif()
++ endif()
++endmacro()
++ocv_optimization_process_obsolete_option(ENABLE_SSE SSE ON)
++ocv_optimization_process_obsolete_option(ENABLE_SSE2 SSE2 ON)
++ocv_optimization_process_obsolete_option(ENABLE_SSE3 SSE3 ON)
++ocv_optimization_process_obsolete_option(ENABLE_SSSE3 SSSE3 ON)
++ocv_optimization_process_obsolete_option(ENABLE_SSE41 SSE4_1 ON)
++ocv_optimization_process_obsolete_option(ENABLE_SSE42 SSE4_2 ON)
++ocv_optimization_process_obsolete_option(ENABLE_POPCNT POPCNT ON)
++ocv_optimization_process_obsolete_option(ENABLE_AVX AVX ON)
++ocv_optimization_process_obsolete_option(ENABLE_AVX2 AVX2 ON)
++ocv_optimization_process_obsolete_option(ENABLE_FMA3 FMA3 ON)
++
++ocv_optimization_process_obsolete_option(ENABLE_VFPV3 VFPV3 OFF)
++ocv_optimization_process_obsolete_option(ENABLE_NEON NEON OFF)
++
++
++macro(ocv_is_optimization_in_list resultvar check_opt)
++ set(__checked "")
++ set(__queue ${ARGN})
++ set(${resultvar} 0)
++ while(__queue AND NOT ${resultvar})
++ list(REMOVE_DUPLICATES __queue)
++ set(__queue_current ${__queue})
++ set(__queue "")
++ foreach(OPT ${__queue_current})
++ if("x${OPT}" STREQUAL "x${check_opt}")
++ set(${resultvar} 1)
++ break()
++ elseif(NOT ";${__checked};" MATCHES ";${OPT};")
++ list(APPEND __queue ${CPU_${OPT}_IMPLIES})
++ endif()
++ list(APPEND __checked ${OPT})
++ endforeach()
++ endwhile()
++endmacro()
++
++macro(ocv_is_optimization_in_force_list resultvar check_opt)
++ set(__checked "")
++ set(__queue ${ARGN})
++ set(${resultvar} 0)
++ while(__queue AND NOT ${resultvar})
++ list(REMOVE_DUPLICATES __queue)
++ set(__queue_current ${__queue})
++ set(__queue "")
++ foreach(OPT ${__queue_current})
++ if(OPT STREQUAL "${check_opt}")
++ set(${resultvar} 1)
++ break()
++ elseif(NOT ";${__checked};" MATCHES ";${OPT};")
++ list(APPEND __queue ${CPU_${OPT}_FORCE})
++ endif()
++ list(APPEND __checked ${OPT})
++ endforeach()
++ endwhile()
++endmacro()
++
++macro(ocv_append_optimization_flag var OPT)
++ if(CPU_${OPT}_FLAGS_CONFLICT)
++ string(REGEX REPLACE " ${CPU_${OPT}_FLAGS_CONFLICT}" "" ${var} " ${${var}}")
++ string(REGEX REPLACE "^ +" "" ${var} "${${var}}")
++ endif()
++ set(${var} "${${var}} ${CPU_${OPT}_FLAGS_ON}")
++endmacro()
++
++# Support GCC -march=native or Intel Compiler -xHost flags
++if(";${CPU_BASELINE};" MATCHES ";NATIVE;" OR ";${CPU_BASELINE};" MATCHES ";HOST;")
++ set(CPU_BASELINE_DETECT ON)
++ set(_add_native_flag ON)
++elseif(";${CPU_BASELINE};" MATCHES ";DETECT;")
++ set(CPU_BASELINE_DETECT ON)
++elseif(" ${CMAKE_CXX_FLAGS} " MATCHES " -march=native | -xHost | /QxHost ")
++ if(DEFINED CPU_BASELINE)
++ message(STATUS "CPU: Detected '-march=native' or '-xHost' compiler flag. Force CPU_BASELINE=DETECT.")
++ endif()
++ set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
++ set(CPU_BASELINE_DETECT ON)
++endif()
++
++if(X86 OR X86_64)
++ ocv_update(CPU_KNOWN_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;POPCNT;SSE4_2;FP16;FMA3;AVX;AVX2;AVX512")
++
++ ocv_update(CPU_SSE_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse.cpp")
++ ocv_update(CPU_SSE2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp")
++ ocv_update(CPU_SSE3_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse3.cpp")
++ ocv_update(CPU_SSSE3_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_ssse3.cpp")
++ ocv_update(CPU_SSE4_1_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse41.cpp")
++ ocv_update(CPU_SSE4_2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse42.cpp")
++ ocv_update(CPU_POPCNT_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_popcnt.cpp")
++ ocv_update(CPU_AVX_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx.cpp")
++ ocv_update(CPU_AVX2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx2.cpp")
++ ocv_update(CPU_FP16_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_fp16.cpp")
++ ocv_update(CPU_AVX512_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512.cpp")
++
++ if(NOT OPENCV_CPU_OPT_IMPLIES_IGNORE)
++ ocv_update(CPU_AVX512_IMPLIES "AVX2")
++ ocv_update(CPU_AVX512_FORCE "") # Don't force other optimizations
++ ocv_update(CPU_AVX2_IMPLIES "AVX;FMA3;FP16")
++ ocv_update(CPU_FMA3_IMPLIES "AVX2")
++ ocv_update(CPU_FMA3_FORCE "") # Don't force other optimizations
++ ocv_update(CPU_FP16_IMPLIES "AVX")
++ ocv_update(CPU_FP16_FORCE "") # Don't force other optimizations
++ ocv_update(CPU_AVX_IMPLIES "SSE4_2")
++ ocv_update(CPU_SSE4_2_IMPLIES "SSE4_1;POPCNT")
++ ocv_update(CPU_POPCNT_IMPLIES "SSE4_1")
++ ocv_update(CPU_POPCNT_FORCE "") # Don't force other optimizations
++ ocv_update(CPU_SSE4_1_IMPLIES "SSE3;SSSE3")
++ ocv_update(CPU_SSSE3_IMPLIES "SSE3")
++ ocv_update(CPU_SSE3_IMPLIES "SSE2")
++ ocv_update(CPU_SSE2_IMPLIES "SSE")
++ endif()
++
++ if(CV_ICC)
++ macro(ocv_intel_compiler_optimization_option name unix_flags msvc_flags)
++ ocv_update(CPU_${name}_FLAGS_NAME "${name}")
++ if(MSVC)
++ set(enable_flags "${msvc_flags}")
++ set(flags_conflict "/arch:[^ ]+")
++ else()
++ set(enable_flags "${unix_flags}")
++ set(flags_conflict "-msse[^ ]*|-mssse3|-mavx[^ ]*|-march[^ ]+")
++ endif()
++ ocv_update(CPU_${name}_FLAGS_ON "${enable_flags}")
++ if(flags_conflict)
++ ocv_update(CPU_${name}_FLAGS_CONFLICT "${flags_conflict}")
++ endif()
++ endmacro()
++ ocv_intel_compiler_optimization_option(AVX2 "-march=core-avx2" "/arch:CORE-AVX2")
++ ocv_intel_compiler_optimization_option(FP16 "-mavx" "/arch:AVX")
++ ocv_intel_compiler_optimization_option(AVX "-mavx" "/arch:AVX")
++ ocv_intel_compiler_optimization_option(FMA3 "" "")
++ ocv_intel_compiler_optimization_option(POPCNT "" "")
++ ocv_intel_compiler_optimization_option(SSE4_2 "-msse4.2" "/arch:SSE4.2")
++ ocv_intel_compiler_optimization_option(SSE4_1 "-msse4.1" "/arch:SSE4.1")
++ ocv_intel_compiler_optimization_option(SSE3 "-msse3" "/arch:SSE3")
++ ocv_intel_compiler_optimization_option(SSSE3 "-mssse3" "/arch:SSSE3")
++ ocv_intel_compiler_optimization_option(SSE2 "-msse2" "/arch:SSE2")
++ if(NOT X86_64) # x64 compiler doesn't support /arch:sse
++ ocv_intel_compiler_optimization_option(SSE "-msse" "/arch:SSE")
++ endif()
++ #ocv_intel_compiler_optimization_option(AVX512 "-march=core-avx512")
++ elseif(CMAKE_COMPILER_IS_GNUCXX)
++ ocv_update(CPU_AVX2_FLAGS_ON "-mavx2")
++ ocv_update(CPU_FP16_FLAGS_ON "-mf16c")
++ ocv_update(CPU_AVX_FLAGS_ON "-mavx")
++ ocv_update(CPU_FMA3_FLAGS_ON "-mfma")
++ ocv_update(CPU_POPCNT_FLAGS_ON "-mpopcnt")
++ ocv_update(CPU_SSE4_2_FLAGS_ON "-msse4.2")
++ ocv_update(CPU_SSE4_1_FLAGS_ON "-msse4.1")
++ ocv_update(CPU_SSE3_FLAGS_ON "-msse3")
++ ocv_update(CPU_SSSE3_FLAGS_ON "-mssse3")
++ ocv_update(CPU_SSE2_FLAGS_ON "-msse2")
++ ocv_update(CPU_SSE_FLAGS_ON "-msse")
++ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
++ ocv_update(CPU_AVX512_FLAGS_ON "-mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi")
++ endif()
++ elseif(MSVC)
++ ocv_update(CPU_AVX2_FLAGS_ON "/arch:AVX2")
++ ocv_update(CPU_AVX_FLAGS_ON "/arch:AVX")
++ if(NOT MSVC64)
++ # 64-bit MSVC compiler uses SSE/SSE2 by default
++ ocv_update(CPU_SSE_FLAGS_ON "/arch:SSE")
++ ocv_update(CPU_SSE_SUPPORTED ON)
++ ocv_update(CPU_SSE2_FLAGS_ON "/arch:SSE2")
++ ocv_update(CPU_SSE2_SUPPORTED ON)
++ else()
++ ocv_update(CPU_SSE_SUPPORTED ON)
++ ocv_update(CPU_SSE2_SUPPORTED ON)
++ endif()
++ # Other instruction sets are supported by default since MSVC 2008 at least
++ else()
++ message(WARNING "TODO: Unsupported compiler")
++ endif()
++
++ if(NOT DEFINED CPU_DISPATCH)
++ set(CPU_DISPATCH "SSE4_1;AVX;FP16;AVX2" CACHE STRING "${HELP_CPU_DISPATCH}")
++ endif()
++
++ if(NOT DEFINED CPU_BASELINE)
++ if(X86_64)
++ set(CPU_BASELINE "SSSE3" CACHE STRING "${HELP_CPU_BASELINE}")
++ else()
++ set(CPU_BASELINE "SSE2" CACHE STRING "${HELP_CPU_BASELINE}")
++ endif()
++ endif()
++
++elseif(ARM OR AARCH64)
++ ocv_update(CPU_FP16_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_fp16.cpp")
++ if(NOT AARCH64)
++ ocv_update(CPU_KNOWN_OPTIMIZATIONS "VFPV3;NEON;FP16")
++ ocv_update(CPU_NEON_FLAGS_ON "-mfpu=neon")
++ ocv_update(CPU_VFPV3_FLAGS_ON "-mfpu=vfpv3")
++ ocv_update(CPU_FP16_FLAGS_ON "-mfpu=neon-fp16")
++ set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
++ else()
++ ocv_update(CPU_KNOWN_OPTIMIZATIONS "NEON;FP16")
++ ocv_update(CPU_NEON_FLAGS_ON "")
++ set(CPU_BASELINE "NEON" CACHE STRING "${HELP_CPU_BASELINE}")
++ endif()
++endif()
++
++# Helper values for cmake-gui
++set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
++set(CPU_DISPATCH "" CACHE STRING "${HELP_CPU_DISPATCH}")
++set_property(CACHE CPU_BASELINE PROPERTY STRINGS "" ${CPU_KNOWN_OPTIMIZATIONS})
++set_property(CACHE CPU_DISPATCH PROPERTY STRINGS "" ${CPU_KNOWN_OPTIMIZATIONS})
++
++set(CPU_BASELINE_FLAGS "")
++
++set(CPU_BASELINE_FINAL "")
++set(CPU_DISPATCH_FINAL "")
++
++macro(ocv_check_compiler_optimization OPT)
++ if(NOT DEFINED CPU_${OPT}_SUPPORTED)
++ if((DEFINED CPU_${OPT}_FLAGS_ON AND NOT "x${CPU_${OPT}_FLAGS_ON}" STREQUAL "x") OR CPU_${OPT}_TEST_FILE)
++ set(_varname "")
++ if(CPU_${OPT}_TEST_FILE)
++ set(__available 0)
++ if(CPU_BASELINE_DETECT)
++ set(_varname "HAVE_CPU_${OPT}_SUPPORT")
++ ocv_check_compiler_flag(CXX "${CPU_BASELINE_FLAGS}" "${_varname}" "${CPU_${OPT}_TEST_FILE}")
++ if(${_varname})
++ list(APPEND CPU_BASELINE_FINAL ${OPT})
++ set(__available 1)
++ endif()
++ endif()
++ if(NOT __available)
++ if(NOT "x${CPU_${OPT}_FLAGS_NAME}" STREQUAL "x")
++ set(_varname "HAVE_CPU_${CPU_${OPT}_FLAGS_NAME}")
++ set(_compile_flags "${CPU_BASELINE_FLAGS}")
++ ocv_append_optimization_flag(_compile_flags ${OPT})
++ ocv_check_compiler_flag(CXX "${_compile_flags}" "${_varname}" "${CPU_${OPT}_TEST_FILE}")
++ elseif(NOT "x${CPU_${OPT}_FLAGS_ON}" STREQUAL "x")
++ ocv_check_flag_support(CXX "${CPU_${OPT}_FLAGS_ON}" _varname "" "${CPU_${OPT}_TEST_FILE}")
++ else()
++ set(_varname "HAVE_CPU_${OPT}_SUPPORT")
++ set(_compile_flags "${CPU_BASELINE_FLAGS}")
++ ocv_append_optimization_flag(_compile_flags ${OPT})
++ ocv_check_compiler_flag(CXX "${_compile_flags}" "${_varname}" "${CPU_${OPT}_TEST_FILE}")
++ endif()
++ endif()
++ else()
++ ocv_check_flag_support(CXX "${CPU_${OPT}_FLAGS_ON}" _varname "")
++ endif()
++ if(_varname AND ${_varname})
++ set(CPU_${OPT}_SUPPORTED ON)
++ elseif(NOT CPU_${OPT}_SUPPORTED)
++ message(STATUS "${OPT} is not supported by C++ compiler")
++ endif()
++ else()
++ set(CPU_${OPT}_SUPPORTED ON)
++ endif()
++ endif()
++endmacro()
++
++foreach(OPT ${CPU_KNOWN_OPTIMIZATIONS})
++ set(CPU_${OPT}_USAGE_COUNT 0 CACHE INTERNAL "" FORCE)
++ if(NOT DEFINED CPU_${OPT}_FORCE)
++ set(CPU_${OPT}_FORCE "${CPU_${OPT}_IMPLIES}")
++ endif()
++endforeach()
++
++if(_add_native_flag)
++ set(_varname "HAVE_CPU_NATIVE_SUPPORT")
++ ocv_check_compiler_flag(CXX "-march=native" "${_varname}" "")
++ if(_varname)
++ set(CPU_BASELINE_FLAGS "${CPU_BASELINE_FLAGS} -march=native")
++ else()
++ set(_varname "HAVE_CPU_HOST_SUPPORT")
++ if(MSVC)
++ set(_flag "/QxHost")
++ else()
++ set(_flag "-xHost")
++ endif()
++ ocv_check_compiler_flag(CXX "${_flag}" "${_varname}" "")
++ if(_varname)
++ set(CPU_BASELINE_FLAGS "${CPU_BASELINE_FLAGS} ${flag}")
++ endif()
++ endif()
++endif()
++
++foreach(OPT ${CPU_KNOWN_OPTIMIZATIONS})
++ set(__is_disabled 0)
++ foreach(OPT2 ${CPU_BASELINE_DISABLE})
++ ocv_is_optimization_in_list(__is_disabled ${OPT2} ${OPT})
++ if(__is_disabled)
++ break()
++ endif()
++ endforeach()
++ if(__is_disabled)
++ set(__is_from_baseline 0)
++ else()
++ ocv_is_optimization_in_list(__is_from_baseline ${OPT} ${CPU_BASELINE_REQUIRE})
++ if(NOT __is_from_baseline)
++ ocv_is_optimization_in_list(__is_from_baseline ${OPT} ${CPU_BASELINE})
++ endif()
++ endif()
++ ocv_is_optimization_in_list(__is_from_dispatch ${OPT} ${CPU_DISPATCH_REQUIRE})
++ if(NOT __is_from_dispatch)
++ ocv_is_optimization_in_list(__is_from_dispatch ${OPT} ${CPU_DISPATCH})
++ endif()
++ if(__is_from_dispatch OR __is_from_baseline OR CPU_BASELINE_DETECT)
++ ocv_check_compiler_optimization(${OPT})
++ endif()
++ if(CPU_BASELINE_DETECT AND NOT __is_from_baseline AND NOT __is_disabled)
++ ocv_is_optimization_in_list(__is_from_baseline ${OPT} ${CPU_BASELINE_FINAL})
++ endif()
++ if(CPU_${OPT}_SUPPORTED)
++ if(";${CPU_DISPATCH};" MATCHES ";${OPT};" AND NOT __is_from_baseline)
++ list(APPEND CPU_DISPATCH_FINAL ${OPT})
++ elseif(__is_from_baseline AND NOT CPU_BASELINE_DETECT)
++ list(APPEND CPU_BASELINE_FINAL ${OPT})
++ ocv_append_optimization_flag(CPU_BASELINE_FLAGS ${OPT})
++ endif()
++ endif()
++endforeach()
++
++foreach(OPT ${CPU_BASELINE_REQUIRE})
++ if(NOT ";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
++ message(SEND_ERROR "Required baseline optimization is not supported: ${OPT} (CPU_BASELINE_REQUIRE=${CPU_BASELINE_REQUIRE})")
++ endif()
++endforeach()
++
++foreach(OPT ${CPU_BASELINE})
++ if(OPT STREQUAL "DETECT" OR OPT STREQUAL "HOST" OR OPT STREQUAL "NATIVE")
++ # nothing
++ elseif(NOT ";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
++ message(STATUS "Optimization ${OPT} is not available, skipped")
++ endif()
++endforeach()
++
++foreach(OPT ${CPU_DISPATCH_REQUIRE})
++ if(";${CPU_DISPATCH_FINAL};" MATCHES ";${OPT};")
++ # OK
++ elseif(";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
++ message(SEND_ERROR "Dispatched optimization ${OPT} is in baseline list (CPU_DISPATCH_REQUIRE=${CPU_DISPATCH_REQUIRE})")
++ else()
++ message(SEND_ERROR "Required dispatch optimization is not supported: ${OPT} (CPU_DISPATCH_REQUIRE=${CPU_DISPATCH_REQUIRE})")
++ endif()
++endforeach()
++
++foreach(OPT ${CPU_DISPATCH})
++ if(";${CPU_DISPATCH_FINAL};" MATCHES ";${OPT};")
++ # OK
++ elseif(";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
++ # OK
++ else()
++ message(STATUS "Dispatch optimization ${OPT} is not available, skipped")
++ endif()
++endforeach()
++
++#message(STATUS "CPU_BASELINE_FINAL=${CPU_BASELINE_FINAL}")
++#message(STATUS "CPU_DISPATCH_FINAL=${CPU_DISPATCH_FINAL}")
++
++#if(CPU_DISPATCH_FINAL AND NOT PYTHON_DEFAULT_EXECUTABLE)
++# message(FATAL_ERROR "Python is required for CPU dispatched optimization support")
++#endif()
++
++macro(ocv_compiler_optimization_options)
++ set(__flags "${OPENCV_EXTRA_CXX_FLAGS} ${CPU_BASELINE_FLAGS}")
++ if(NOT __flags STREQUAL CACHED_CPU_BASELINE_FLAGS)
++ set(CACHED_CPU_BASELINE_FLAGS "${__flags}" CACHE INTERNAL "" FORCE)
++ ocv_clear_vars(HAVE_CPU_BASELINE_FLAGS)
++ endif()
++ ocv_check_compiler_flag(CXX "${__flags}" HAVE_CPU_BASELINE_FLAGS)
++ if(NOT HAVE_CPU_BASELINE_FLAGS)
++ message(FATAL_ERROR "Compiler doesn't support baseline optimization flags: ${CPU_BASELINE_FLAGS}")
++ endif()
++ add_extra_compiler_option_force("${CPU_BASELINE_FLAGS}")
++
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ set(__dispatch_flags "")
++ set(__dispatch_definitions "")
++ set(__dispatch_opts "")
++ set(__dispatch_opts_force "")
++ foreach(OPT2 ${CPU_KNOWN_OPTIMIZATIONS})
++ if(NOT CPU_${OPT2}_SUPPORTED)
++ #continue()
++ else()
++ ocv_is_optimization_in_list(__is_from_baseline ${OPT2} ${CPU_BASELINE_FINAL})
++ if(NOT __is_from_baseline)
++ ocv_is_optimization_in_list(__is_active ${OPT2} ${OPT})
++ if(__is_active)
++ ocv_append_optimization_flag(__dispatch_flags ${OPT2})
++ list(APPEND __dispatch_definitions "CV_CPU_COMPILE_${OPT2}=1")
++ list(APPEND __dispatch_opts "${OPT2}")
++ endif()
++ ocv_is_optimization_in_force_list(__is_force ${OPT2} ${OPT})
++ if(__is_force)
++ list(APPEND __dispatch_opts_force "${OPT2}")
++ endif()
++ endif()
++ endif()
++ endforeach()
++ set(__flags "${OPENCV_EXTRA_CXX_FLAGS} ${__dispatch_flags}")
++ if(NOT __flags STREQUAL CACHED_CPU_DISPATCH_${OPT}_FLAGS)
++ set(CACHED_CPU_DISPATCH_${OPT}_FLAGS "${__flags}" CACHE INTERNAL "" FORCE)
++ ocv_clear_vars(HAVE_CPU_DISPATCH_FLAGS_${OPT})
++ endif()
++ ocv_check_compiler_flag(CXX "${__flags}" HAVE_CPU_DISPATCH_FLAGS_${OPT})
++ if(NOT HAVE_CPU_DISPATCH_FLAGS_${OPT})
++ message(FATAL_ERROR "Compiler doesn't support optimization flags for ${OPT} dispatch mode: ${__dispatch_flags}")
++ endif()
++ set(CPU_DISPATCH_FLAGS_${OPT} "${__dispatch_flags}")
++ set(CPU_DISPATCH_DEFINITIONS_${OPT} "${__dispatch_definitions}")
++ set(CPU_DISPATCH_${OPT}_INCLUDED "${__dispatch_opts}")
++ set(CPU_DISPATCH_${OPT}_FORCED "${__dispatch_opts_force}")
++ endforeach()
++
++ if(ENABLE_POWERPC)
++ add_extra_compiler_option("-mcpu=G3 -mtune=G5")
++ endif()
++ if(ARM)
++ add_extra_compiler_option("-mfp16-format=ieee")
++ endif(ARM)
++ if(ENABLE_NEON)
++ add_extra_compiler_option("-mfpu=neon")
++ endif()
++ if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
++ add_extra_compiler_option("-mfpu=vfpv3")
++ endif()
++endmacro()
++
++macro(ocv_compiler_optimization_options_finalize)
++ if(CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64))
++ if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
++ if(OPENCV_EXTRA_CXX_FLAGS MATCHES "-m(sse2|avx)")
++ add_extra_compiler_option(-mfpmath=sse) # !! important - be on the same wave with x64 compilers
++ else()
++ add_extra_compiler_option(-mfpmath=387)
++ endif()
++ endif()
++ endif()
++
++ if(MSVC)
++ # Generate Intrinsic Functions
++ set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Oi")
++
++ if((X86 OR X86_64) AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND ";${CPU_BASELINE_FINAL};" MATCHES ";SSE;")
++ set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
++ endif()
++ endif(MSVC)
++endmacro()
++
++macro(ocv_compiler_optimization_process_sources SOURCES_VAR_NAME LIBS_VAR_NAME TARGET_BASE_NAME)
++ set(__result "")
++ set(__result_libs "")
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ set(__result_${OPT} "")
++ endforeach()
++ foreach(fname ${${SOURCES_VAR_NAME}})
++ string(TOLOWER "${fname}" fname_LOWER)
++ if(fname_LOWER MATCHES "[.]opt_.*[.]cpp$")
++ if(CV_DISABLE_OPTIMIZATION OR NOT CV_ENABLE_INTRINSICS)
++ message(STATUS "Excluding from source files list: ${fname}")
++ #continue()
++ else()
++ set(__opt_found 0)
++ foreach(OPT ${CPU_BASELINE_FINAL})
++ string(TOLOWER "${OPT}" OPT_LOWER)
++ if(fname_LOWER MATCHES "_${OPT_LOWER}[.]cpp$")
++#message("${fname} BASELINE-${OPT}")
++ set(__opt_found 1)
++ list(APPEND __result "${fname}")
++ break()
++ endif()
++ endforeach()
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ foreach(OPT2 ${CPU_DISPATCH_${OPT}_FORCED})
++ string(TOLOWER "${OPT2}" OPT2_LOWER)
++ if(fname_LOWER MATCHES "_${OPT2_LOWER}[.]cpp$")
++ list(APPEND __result_${OPT} "${fname}")
++ math(EXPR CPU_${OPT}_USAGE_COUNT "${CPU_${OPT}_USAGE_COUNT}+1")
++ set(CPU_${OPT}_USAGE_COUNT "${CPU_${OPT}_USAGE_COUNT}" CACHE INTERNAL "" FORCE)
++#message("${fname} ${OPT}")
++#message(" ${CPU_DISPATCH_${OPT}_INCLUDED}")
++#message(" ${CPU_DISPATCH_DEFINITIONS_${OPT}}")
++#message(" ${CPU_DISPATCH_FLAGS_${OPT}}")
++ set(__opt_found 1)
++ break()
++ endif()
++ endforeach()
++ if(__opt_found)
++ set(__opt_found 1)
++ break()
++ endif()
++ endforeach()
++ if(NOT __opt_found)
++ message(STATUS "Excluding from source files list: ${fname}")
++ endif()
++ endif()
++ else()
++ list(APPEND __result "${fname}")
++ endif()
++ endforeach()
++
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ if(__result_${OPT})
++#message("${OPT}: ${__result_${OPT}}")
++ if(CMAKE_GENERATOR MATCHES "^Visual")
++ # extra flags are added before common flags, so switching between optimizations doesn't work correctly
++ # Also CMAKE_CXX_FLAGS doesn't work (it is directory-based, so add_subdirectory is required)
++ add_library(${TARGET_BASE_NAME}_${OPT} OBJECT ${__result_${OPT}})
++ ocv_append_dependant_targets(${TARGET_BASE_NAME} ${TARGET_BASE_NAME}_${OPT})
++ set_target_properties(${TARGET_BASE_NAME}_${OPT} PROPERTIES COMPILE_DEFINITIONS "${CPU_DISPATCH_DEFINITIONS_${OPT}}")
++ set_target_properties(${TARGET_BASE_NAME}_${OPT} PROPERTIES COMPILE_FLAGS "${CPU_DISPATCH_FLAGS_${OPT}}")
++ #list(APPEND __result_libs ${TARGET_BASE_NAME}_${OPT})
++ list(APPEND __result "$<TARGET_OBJECTS:${TARGET_BASE_NAME}_${OPT}>")
++ else()
++ foreach(fname ${__result_${OPT}})
++ set_source_files_properties("${fname}" PROPERTIES COMPILE_DEFINITIONS "${CPU_DISPATCH_DEFINITIONS_${OPT}}")
++ set_source_files_properties("${fname}" PROPERTIES COMPILE_FLAGS "${CPU_DISPATCH_FLAGS_${OPT}}")
++ endforeach()
++ list(APPEND __result ${__result_${OPT}})
++ endif()
++ endif()
++ endforeach()
++ set(${SOURCES_VAR_NAME} "${__result}")
++ list(APPEND ${LIBS_VAR_NAME} ${__result_libs})
++endmacro()
++
++macro(ocv_compiler_optimization_fill_cpu_config)
++ set(OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE "")
++ foreach(OPT ${CPU_BASELINE_FINAL})
++ set(OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE}
++#define CV_CPU_COMPILE_${OPT} 1
++#define CV_CPU_BASELINE_COMPILE_${OPT} 1
++")
++ endforeach()
++
++ set(OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE}
++#define CV_CPU_BASELINE_FEATURES 0 \\")
++ foreach(OPT ${CPU_BASELINE_FINAL})
++ if(NOT DEFINED CPU_${OPT}_FEATURE_ALIAS OR NOT "x${CPU_${OPT}_FEATURE_ALIAS}" STREQUAL "x")
++ set(OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE}
++ , CV_CPU_${OPT} \\")
++ endif()
++ endforeach()
++ set(OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE}\n")
++
++ set(__dispatch_modes "")
++ foreach(OPT ${CPU_DISPATCH_FINAL})
++ list(APPEND __dispatch_modes ${CPU_DISPATCH_${OPT}_FORCE} ${OPT})
++ endforeach()
++ list(REMOVE_DUPLICATES __dispatch_modes)
++ set(OPENCV_CPU_DISPATCH_DEFINITIONS_CONFIGMAKE "")
++ foreach(OPT ${__dispatch_modes})
++ set(OPENCV_CPU_DISPATCH_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_DISPATCH_DEFINITIONS_CONFIGMAKE}
++#define CV_CPU_DISPATCH_COMPILE_${OPT} 1")
++ endforeach()
++
++ set(OPENCV_CPU_CONTROL_DEFINITIONS_CONFIGMAKE "// AUTOGENERATED, DO NOT EDIT\n")
++ foreach(OPT ${CPU_ALL_OPTIMIZATIONS})
++ if(NOT DEFINED CPU_${OPT}_FEATURE_ALIAS OR NOT "x${CPU_${OPT}_FEATURE_ALIAS}" STREQUAL "x")
++ set(OPENCV_CPU_CONTROL_DEFINITIONS_CONFIGMAKE "${OPENCV_CPU_CONTROL_DEFINITIONS_CONFIGMAKE}
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_${OPT}
++# define CV_CPU_HAS_SUPPORT_${OPT} 1
++# define CV_CPU_CALL_${OPT}(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_${OPT}
++# define CV_CPU_HAS_SUPPORT_${OPT} (cv::checkHardwareSupport(CV_CPU_${OPT}))
++# define CV_CPU_CALL_${OPT}(...) if (CV_CPU_HAS_SUPPORT_${OPT}) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_${OPT} 0
++# define CV_CPU_CALL_${OPT}(...)
++#endif
++")
++ endif()
++ endforeach()
++
++ set(__file "${CMAKE_SOURCE_DIR}/modules/core/include/opencv2/core/cv_cpu_helper.h")
++ if(EXISTS "${__file}")
++ file(READ "${__file}" __content)
++ endif()
++ if(__content STREQUAL OPENCV_CPU_CONTROL_DEFINITIONS_CONFIGMAKE)
++ #message(STATUS "${__file} contains same content")
++ else()
++ file(WRITE "${__file}" "${OPENCV_CPU_CONTROL_DEFINITIONS_CONFIGMAKE}")
++ message(WARNING "${__file} is updated")
++ endif()
++endmacro()
++
++if(CV_DISABLE_OPTIMIZATION OR CV_ICC)
++ ocv_update(CV_ENABLE_UNROLLED 0)
++else()
++ ocv_update(CV_ENABLE_UNROLLED 1)
++endif()
+diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
+index 5bb047911..0eb68b656 100644
+--- a/cmake/OpenCVCompilerOptions.cmake
++++ b/cmake/OpenCVCompilerOptions.cmake
+@@ -31,24 +31,21 @@ endif()
+ if(MINGW OR (X86 AND UNIX AND NOT APPLE))
+ # mingw compiler is known to produce unstable SSE code with -O3 hence we are trying to use -O2 instead
+ if(CMAKE_COMPILER_IS_GNUCXX)
+- foreach(flags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
+- string(REPLACE "-O3" "-O2" ${flags} "${${flags}}")
+- endforeach()
+- endif()
+-
+- if(CMAKE_COMPILER_IS_GNUCC)
+- foreach(flags CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG)
++ foreach(flags
++ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG
++ CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG)
+ string(REPLACE "-O3" "-O2" ${flags} "${${flags}}")
+ endforeach()
+ endif()
+ endif()
+
+ if(MSVC)
+- string(REGEX REPLACE "^ *| * $" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+- string(REGEX REPLACE "^ *| * $" "" CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT}")
++ string(STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
++ string(STRIP "${CMAKE_CXX_FLAGS_INIT}" CMAKE_CXX_FLAGS_INIT)
+ if(CMAKE_CXX_FLAGS STREQUAL CMAKE_CXX_FLAGS_INIT)
+ # override cmake default exception handling option
+- string(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++ string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+ endif()
+ endif()
+@@ -63,9 +60,6 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "")
+ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "")
+
+ macro(add_extra_compiler_option option)
+- if(CMAKE_BUILD_TYPE)
+- set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+- endif()
+ ocv_check_flag_support(CXX "${option}" _varname "${OPENCV_EXTRA_CXX_FLAGS} ${ARGN}")
+ if(${_varname})
+ set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} ${option}")
+@@ -77,6 +71,12 @@ macro(add_extra_compiler_option option)
+ endif()
+ endmacro()
+
++macro(add_extra_compiler_option_force option)
++ set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} ${option}")
++ set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} ${option}")
++endmacro()
++
++
+ # Gets environment variable and puts its value to the corresponding preprocessor definition
+ # Useful for WINRT that has no access to environment variables
+ macro(add_env_definitions option)
+@@ -102,7 +102,11 @@ if(MINGW)
+ endif()
+
+ if(CV_ICC AND NOT ENABLE_FAST_MATH)
+- add_extra_compiler_option("-fp-model precise")
++ if(MSVC)
++ add_extra_compiler_option("/fp:precise")
++ else()
++ add_extra_compiler_option("-fp-model precise")
++ endif()
+ endif()
+
+ if(CMAKE_COMPILER_IS_GNUCXX)
+@@ -141,7 +145,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ endif()
+
+ # We need pthread's
+- if(UNIX AND NOT ANDROID AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX))
++ if(UNIX AND NOT ANDROID AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX)) # TODO
+ add_extra_compiler_option(-pthread)
+ endif()
+
+@@ -170,83 +174,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ if(ENABLE_FAST_MATH)
+ add_extra_compiler_option(-ffast-math)
+ endif()
+- if(ENABLE_POWERPC)
+- add_extra_compiler_option("-mcpu=G3 -mtune=G5")
+- endif()
+- if(ENABLE_SSE)
+- add_extra_compiler_option(-msse)
+- endif()
+- if(ENABLE_SSE2)
+- add_extra_compiler_option(-msse2)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse2)
+- endif()
+- if(ARM)
+- add_extra_compiler_option("-mfp16-format=ieee")
+- endif(ARM)
+- if(ENABLE_NEON)
+- add_extra_compiler_option("-mfpu=neon")
+- endif()
+- if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
+- add_extra_compiler_option("-mfpu=vfpv3")
+- endif()
+-
+- # SSE3 and further should be disabled under MingW because it generates compiler errors
+- if(NOT MINGW)
+- if(ENABLE_AVX)
+- add_extra_compiler_option(-mavx)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-avx)
+- endif()
+- if(ENABLE_AVX2)
+- add_extra_compiler_option(-mavx2)
+-
+- if(ENABLE_FMA3)
+- add_extra_compiler_option(-mfma)
+- endif()
+- endif()
+-
+- # GCC depresses SSEx instructions when -mavx is used. Instead, it generates new AVX instructions or AVX equivalence for all SSEx instructions when needed.
+- if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
+- if(ENABLE_SSE3)
+- add_extra_compiler_option(-msse3)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse3)
+- endif()
+-
+- if(ENABLE_SSSE3)
+- add_extra_compiler_option(-mssse3)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-ssse3)
+- endif()
+-
+- if(ENABLE_SSE41)
+- add_extra_compiler_option(-msse4.1)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse4.1)
+- endif()
+-
+- if(ENABLE_SSE42)
+- add_extra_compiler_option(-msse4.2)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse4.2)
+- endif()
+-
+- if(ENABLE_POPCNT)
+- add_extra_compiler_option(-mpopcnt)
+- endif()
+- endif()
+- endif(NOT MINGW)
+-
+- if(X86 OR X86_64)
+- if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+- if(OPENCV_EXTRA_CXX_FLAGS MATCHES "-m(sse2|avx)")
+- add_extra_compiler_option(-mfpmath=sse)# !! important - be on the same wave with x64 compilers
+- else()
+- add_extra_compiler_option(-mfpmath=387)
+- endif()
+- endif()
+- endif()
+
+ # Profiling?
+ if(ENABLE_PROFILING)
+@@ -257,7 +184,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ string(REPLACE "-fomit-frame-pointer" "" ${flags} "${${flags}}")
+ string(REPLACE "-ffunction-sections" "" ${flags} "${${flags}}")
+ endforeach()
+- elseif(NOT APPLE AND NOT ANDROID)
++ elseif(NOT ((IOS OR ANDROID) AND NOT BUILD_SHARED_LIBS))
+ # Remove unreferenced functions: function level linking
+ add_extra_compiler_option(-ffunction-sections)
+ endif()
+@@ -296,41 +223,6 @@ if(MSVC)
+ set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi")
+ endif()
+
+- if(ENABLE_AVX2 AND NOT MSVC_VERSION LESS 1800)
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:AVX2")
+- endif()
+- if(ENABLE_AVX AND NOT MSVC_VERSION LESS 1600 AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:AVX")
+- endif()
+-
+- if(ENABLE_SSE4_1 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE4.1")
+- endif()
+-
+- if(ENABLE_SSE3 AND CV_ICC AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE3")
+- endif()
+-
+- if(NOT MSVC64)
+- # 64-bit MSVC compiler uses SSE/SSE2 by default
+- if(ENABLE_SSE2 AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE2")
+- endif()
+- if(ENABLE_SSE AND NOT OPENCV_EXTRA_FLAGS MATCHES "/arch:")
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /arch:SSE")
+- endif()
+- endif()
+-
+- if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1 OR ENABLE_AVX OR ENABLE_AVX2)
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /Oi")
+- endif()
+-
+- if(X86 OR X86_64)
+- if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND ENABLE_SSE2)
+- set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
+- endif()
+- endif()
+-
+ if(OPENCV_WARNINGS_ARE_ERRORS)
+ set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
+ endif()
+@@ -353,6 +245,16 @@ if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
+ set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")
+ endif()
+
++include(cmake/OpenCVCompilerOptimizations.cmake)
++
++if(COMMAND ocv_compiler_optimization_options)
++ ocv_compiler_optimization_options()
++endif()
++
++if(COMMAND ocv_compiler_optimization_options_finalize)
++ ocv_compiler_optimization_options_finalize()
++endif()
++
+ # Add user supplied extra options (optimization, etc...)
+ # ==========================================================
+ set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS}" CACHE INTERNAL "Extra compiler options")
+@@ -370,6 +272,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_OPENCV_GCC_VERSION_NUM GREATER 399)
+ add_extra_compiler_option(-fvisibility-inlines-hidden)
+ endif()
+
++# TODO !!!!!
+ if(NOT OPENCV_FP16_DISABLE AND NOT IOS)
+ if(ARM AND ENABLE_NEON)
+ set(FP16_OPTION "-mfpu=neon-fp16")
+@@ -378,7 +281,7 @@ if(NOT OPENCV_FP16_DISABLE AND NOT IOS)
+ endif()
+ try_compile(__VALID_FP16
+ "${OpenCV_BINARY_DIR}"
+- "${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
++ "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_fp16.cpp"
+ COMPILE_DEFINITIONS "-DCHECK_FP16" "${FP16_OPTION}"
+ OUTPUT_VARIABLE TRY_OUT
+ )
+diff --git a/cmake/OpenCVGenHeaders.cmake b/cmake/OpenCVGenHeaders.cmake
+index 298897904..477b91055 100644
+--- a/cmake/OpenCVGenHeaders.cmake
++++ b/cmake/OpenCVGenHeaders.cmake
+@@ -3,6 +3,10 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CO
+ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/cvconfig.h")
+ install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)
+
++# platform-specific config file
++ocv_compiler_optimization_fill_cpu_config()
++configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cv_cpu_config.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cv_cpu_config.h")
++
+ # ----------------------------------------------------------------------------
+ # opencv_modules.hpp based on actual modules list
+ # ----------------------------------------------------------------------------
+diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
+index 742a287ec..3e98bf569 100644
+--- a/cmake/OpenCVModule.cmake
++++ b/cmake/OpenCVModule.cmake
+@@ -65,6 +65,7 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD
+ unset(OPENCV_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE)
+ unset(OPENCV_MODULE_${mod}_LINK_DEPS CACHE)
+ unset(OPENCV_MODULE_${mod}_WRAPPERS CACHE)
++ unset(OPENCV_DEPENDANT_TARGETS_${mod} CACHE)
+ endforeach()
+
+ # clean modules info which needs to be recalculated
+@@ -641,6 +642,8 @@ macro(ocv_set_module_sources)
+ # use full paths for module to be independent from the module location
+ ocv_convert_to_full_paths(OPENCV_MODULE_${the_module}_HEADERS)
+
++ ocv_compiler_optimization_process_sources(OPENCV_MODULE_${the_module}_SOURCES OPENCV_MODULE_${the_module}_DEPS_EXT ${the_module})
++
+ set(OPENCV_MODULE_${the_module}_HEADERS ${OPENCV_MODULE_${the_module}_HEADERS} CACHE INTERNAL "List of header files for ${the_module}")
+ set(OPENCV_MODULE_${the_module}_SOURCES ${OPENCV_MODULE_${the_module}_SOURCES} CACHE INTERNAL "List of source files for ${the_module}")
+ endmacro()
+diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
+index 90437cb20..45968e78b 100644
+--- a/cmake/OpenCVPCHSupport.cmake
++++ b/cmake/OpenCVPCHSupport.cmake
+@@ -326,7 +326,10 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input)
+
+ get_target_property(_sources ${_targetName} SOURCES)
+ foreach(src ${_sources})
+- if(NOT "${src}" MATCHES "\\.mm$")
++ if(NOT "${src}" MATCHES "\\.mm$"
++ AND NOT "${src}" MATCHES "\\.h$" AND NOT "${src}" MATCHES "\\.hpp$" # header files
++ AND NOT "${src}" MATCHES "^\$" # CMake generator expressions
++ )
+ get_source_file_property(oldProps "${src}" COMPILE_FLAGS)
+ if(NOT oldProps)
+ set(newProperties "/Yu\"${_input}\" /FI\"${_input}\"")
+diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
+index cdf257d5f..8a5ee28f6 100644
+--- a/cmake/OpenCVUtils.cmake
++++ b/cmake/OpenCVUtils.cmake
+@@ -37,7 +37,11 @@ endmacro()
+
+ macro(ocv_update VAR)
+ if(NOT DEFINED ${VAR})
+- set(${VAR} ${ARGN})
++ if("x${ARGN}" STREQUAL "x")
++ set(${VAR} "")
++ else()
++ set(${VAR} ${ARGN})
++ endif()
+ else()
+ #ocv_debug_message("Preserve old value for ${VAR}: ${${VAR}}")
+ endif()
+@@ -151,8 +155,15 @@ function(ocv_append_target_property target prop)
+ endif()
+ endfunction()
+
++function(ocv_append_dependant_targets target)
++ #ocv_debug_message("ocv_append_dependant_targets(${target} ${ARGN})")
++ _ocv_fix_target(target)
++ set(OPENCV_DEPENDANT_TARGETS_${target} "${OPENCV_DEPENDANT_TARGETS_${target}};${ARGN}" CACHE INTERNAL "" FORCE)
++endfunction()
++
+ # adds include directories in such way that directories from the OpenCV source tree go first
+ function(ocv_target_include_directories target)
++ #ocv_debug_message("ocv_target_include_directories(${target} ${ARGN})")
+ _ocv_fix_target(target)
+ set(__params "")
+ if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
+@@ -173,6 +184,11 @@ function(ocv_target_include_directories target)
+ else()
+ if(TARGET ${target})
+ target_include_directories(${target} PRIVATE ${__params})
++ if(OPENCV_DEPENDANT_TARGETS_${target})
++ foreach(t ${OPENCV_DEPENDANT_TARGETS_${target}})
++ target_include_directories(${t} PRIVATE ${__params})
++ endforeach()
++ endif()
+ else()
+ set(__new_inc "${OCV_TARGET_INCLUDE_DIRS_${target}};${__params}")
+ set(OCV_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "")
+@@ -205,8 +221,11 @@ set(OCV_COMPILER_FAIL_REGEX
+ )
+
+ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
++ set(_fname "${ARGN}")
+ if(NOT DEFINED ${RESULT})
+- if("_${LANG}_" MATCHES "_CXX_")
++ if(_fname)
++ # nothing
++ elseif("_${LANG}_" MATCHES "_CXX_")
+ set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx")
+ if("${CMAKE_CXX_FLAGS} ${FLAG} " MATCHES "-Werror " OR "${CMAKE_CXX_FLAGS} ${FLAG} " MATCHES "-Werror=unknown-pragmas ")
+ FILE(WRITE "${_fname}" "int main() { return 0; }\n")
+@@ -231,7 +250,13 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
+ unset(_fname)
+ endif()
+ if(_fname)
+- MESSAGE(STATUS "Performing Test ${RESULT}")
++ if(NOT "x${ARGN}" STREQUAL "x")
++ file(RELATIVE_PATH __msg "${CMAKE_SOURCE_DIR}" "${ARGN}")
++ set(__msg " (check file: ${__msg})")
++ else()
++ set(__msg "")
++ endif()
++ MESSAGE(STATUS "Performing Test ${RESULT}${__msg}")
+ TRY_COMPILE(${RESULT}
+ "${CMAKE_BINARY_DIR}"
+ "${_fname}"
+@@ -278,7 +303,11 @@ MACRO(ocv_check_compiler_flag LANG FLAG RESULT)
+ endif()
+ ENDMACRO()
+
+-macro(ocv_check_flag_support lang flag varname)
++macro(ocv_check_flag_support lang flag varname base_options)
++ if(CMAKE_BUILD_TYPE)
++ set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
++ endif()
++
+ if("_${lang}_" MATCHES "_CXX_")
+ set(_lang CXX)
+ elseif("_${lang}_" MATCHES "_C_")
+@@ -293,7 +322,7 @@ macro(ocv_check_flag_support lang flag varname)
+ string(REGEX REPLACE "^(/|-)" "HAVE_${_lang}_" ${varname} "${${varname}}")
+ string(REGEX REPLACE " -|-|=| |\\." "_" ${varname} "${${varname}}")
+
+- ocv_check_compiler_flag("${_lang}" "${ARGN} ${flag}" ${${varname}})
++ ocv_check_compiler_flag("${_lang}" "${base_options} ${flag}" ${${varname}} ${ARGN})
+ endmacro()
+
+ # turns off warnings
+@@ -327,7 +356,7 @@ macro(ocv_warnings_disable)
+ string(REPLACE "${warning}" "" ${var} "${${var}}")
+ string(REPLACE "-W" "-Wno-" warning "${warning}")
+ endif()
+- ocv_check_flag_support(${var} "${warning}" _varname)
++ ocv_check_flag_support(${var} "${warning}" _varname "")
+ if(${_varname})
+ set(${var} "${${var}} ${warning}")
+ endif()
+@@ -342,7 +371,7 @@ macro(ocv_warnings_disable)
+ else()
+ string(REPLACE "-wd" "-Qwd" warning "${warning}")
+ endif()
+- ocv_check_flag_support(${var} "${warning}" _varname)
++ ocv_check_flag_support(${var} "${warning}" _varname "")
+ if(${_varname})
+ set(${var} "${${var}} ${warning}")
+ endif()
+@@ -357,7 +386,7 @@ macro(ocv_warnings_disable)
+ endmacro()
+
+ macro(add_apple_compiler_options the_module)
+- ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS)
++ ocv_check_flag_support(OBJCXX "-fobjc-exceptions" HAVE_OBJC_EXCEPTIONS "")
+ if(HAVE_OBJC_EXCEPTIONS)
+ foreach(source ${OPENCV_MODULE_${the_module}_SOURCES})
+ if("${source}" MATCHES "\\.mm$")
+@@ -892,6 +921,11 @@ function(_ocv_append_target_includes target)
+ if (TARGET ${target}_object)
+ target_include_directories(${target}_object PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
+ endif()
++ if(OPENCV_DEPENDANT_TARGETS_${target})
++ foreach(t ${OPENCV_DEPENDANT_TARGETS_${target}})
++ target_include_directories(${t} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
++ endforeach()
++ endif()
+ unset(OCV_TARGET_INCLUDE_DIRS_${target} CACHE)
+ endif()
+ endfunction()
+diff --git a/cmake/checks/cpu_avx.cpp b/cmake/checks/cpu_avx.cpp
+new file mode 100644
+index 000000000..05536f443
+--- /dev/null
++++ b/cmake/checks/cpu_avx.cpp
+@@ -0,0 +1,9 @@
++#if !defined __AVX__ // MSVC supports this flag since MSVS 2013
++#error "__AVX__ define is missing"
++#endif
++#include <immintrin.h>
++void test()
++{
++ __m256 a = _mm256_set1_ps(0.0f);
++}
++int main() { return 0; }
+diff --git a/cmake/checks/cpu_avx2.cpp b/cmake/checks/cpu_avx2.cpp
+new file mode 100644
+index 000000000..3ab1143b8
+--- /dev/null
++++ b/cmake/checks/cpu_avx2.cpp
+@@ -0,0 +1,10 @@
++#if !defined __AVX2__ // MSVC supports this flag since MSVS 2013
++#error "__AVX2__ define is missing"
++#endif
++#include <immintrin.h>
++void test()
++{
++ int data[8] = {0,0,0,0, 0,0,0,0};
++ __m256i a = _mm256_loadu_si256((const __m256i *)data);
++}
++int main() { return 0; }
+diff --git a/cmake/checks/cpu_avx512.cpp b/cmake/checks/cpu_avx512.cpp
+new file mode 100644
+index 000000000..d0898ab3e
+--- /dev/null
++++ b/cmake/checks/cpu_avx512.cpp
+@@ -0,0 +1,10 @@
++#if defined __AVX512__ || defined __AVX512F__
++#include <immintrin.h>
++void test()
++{
++ __m512i zmm = _mm512_setzero_si512();
++}
++#else
++#error "AVX512 is not supported"
++#endif
++int main() { return 0; }
+diff --git a/cmake/checks/fp16.cpp b/cmake/checks/cpu_fp16.cpp
+similarity index 86%
+rename from cmake/checks/fp16.cpp
+rename to cmake/checks/cpu_fp16.cpp
+index c77c84483..6951f1c4f 100644
+--- a/cmake/checks/fp16.cpp
++++ b/cmake/checks/cpu_fp16.cpp
+@@ -1,6 +1,6 @@
+ #include <stdio.h>
+
+-#if defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700)
++#if defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700) || (defined __INTEL_COMPILER && defined __AVX__)
+ #include <immintrin.h>
+ int test()
+ {
+diff --git a/cmake/checks/cpu_popcnt.cpp b/cmake/checks/cpu_popcnt.cpp
+new file mode 100644
+index 000000000..f55c9f3c5
+--- /dev/null
++++ b/cmake/checks/cpu_popcnt.cpp
+@@ -0,0 +1,8 @@
++#include <nmmintrin.h>
++#ifndef _MSC_VER
++#include <popcntintrin.h>
++#endif
++int main() {
++ int i = _mm_popcnt_u64(1);
++ return 0;
++}
+diff --git a/cmake/checks/cpu_sse.cpp b/cmake/checks/cpu_sse.cpp
+new file mode 100644
+index 000000000..c6269acdb
+--- /dev/null
++++ b/cmake/checks/cpu_sse.cpp
+@@ -0,0 +1,2 @@
++#include <xmmintrin.h>
++int main() { return 0; }
+diff --git a/cmake/checks/cpu_sse2.cpp b/cmake/checks/cpu_sse2.cpp
+new file mode 100644
+index 000000000..68a69f88c
+--- /dev/null
++++ b/cmake/checks/cpu_sse2.cpp
+@@ -0,0 +1,2 @@
++#include <emmintrin.h>
++int main() { return 0; }
+diff --git a/cmake/checks/cpu_sse3.cpp b/cmake/checks/cpu_sse3.cpp
+new file mode 100644
+index 000000000..98ce2191e
+--- /dev/null
++++ b/cmake/checks/cpu_sse3.cpp
+@@ -0,0 +1,7 @@
++#include <pmmintrin.h>
++int main() {
++ __m128 u, v;
++ u = _mm_set1_ps(0.0f);
++ v = _mm_moveldup_ps(u); // SSE3
++ return 0;
++}
+diff --git a/cmake/checks/cpu_sse41.cpp b/cmake/checks/cpu_sse41.cpp
+new file mode 100644
+index 000000000..ddd835b0e
+--- /dev/null
++++ b/cmake/checks/cpu_sse41.cpp
+@@ -0,0 +1,6 @@
++#include <smmintrin.h>
++int main() {
++ __m128i a = _mm_setzero_si128(), b = _mm_setzero_si128();
++ __m128i c = _mm_packus_epi32(a, b);
++ return 0;
++}
+diff --git a/cmake/checks/cpu_sse42.cpp b/cmake/checks/cpu_sse42.cpp
+new file mode 100644
+index 000000000..56f56658a
+--- /dev/null
++++ b/cmake/checks/cpu_sse42.cpp
+@@ -0,0 +1,5 @@
++#include <nmmintrin.h>
++int main() {
++ int i = _mm_popcnt_u64(1);
++ return 0;
++}
+diff --git a/cmake/checks/cpu_ssse3.cpp b/cmake/checks/cpu_ssse3.cpp
+new file mode 100644
+index 000000000..e583199bc
+--- /dev/null
++++ b/cmake/checks/cpu_ssse3.cpp
+@@ -0,0 +1,7 @@
++#include <tmmintrin.h>
++const double v = 0;
++int main() {
++ __m128i a = _mm_setzero_si128();
++ __m128i b = _mm_abs_epi32(a);
++ return 0;
++}
+diff --git a/cmake/templates/cv_cpu_config.h.in b/cmake/templates/cv_cpu_config.h.in
+new file mode 100644
+index 000000000..27b27315c
+--- /dev/null
++++ b/cmake/templates/cv_cpu_config.h.in
+@@ -0,0 +1,5 @@
++// OpenCV CPU baseline features
++ at OPENCV_CPU_BASELINE_DEFINITIONS_CONFIGMAKE@
++
++// OpenCV supported CPU dispatched features
++ at OPENCV_CPU_DISPATCH_DEFINITIONS_CONFIGMAKE@
+diff --git a/cmake/templates/cvconfig.h.in b/cmake/templates/cvconfig.h.in
+index 05add9e2c..658d12c14 100644
+--- a/cmake/templates/cvconfig.h.in
++++ b/cmake/templates/cvconfig.h.in
+@@ -1,6 +1,15 @@
++#ifndef OPENCV_CVCONFIG_H_INCLUDED
++#define OPENCV_CVCONFIG_H_INCLUDED
++
+ /* OpenCV compiled as static or dynamic libs */
+ #cmakedefine BUILD_SHARED_LIBS
+
++/* OpenCV intrinsics optimized code */
++#cmakedefine CV_ENABLE_INTRINSICS
++
++/* OpenCV additional optimized code */
++#cmakedefine CV_DISABLE_OPTIMIZATION
++
+ /* Compile for 'real' NVIDIA GPU architectures */
+ #define CUDA_ARCH_BIN "${OPENCV_CUDA_ARCH_BIN}"
+
+@@ -206,3 +215,7 @@
+
+ /* OpenVX */
+ #cmakedefine HAVE_OPENVX
++
++
++
++#endif // OPENCV_CVCONFIG_H_INCLUDED
+diff --git a/modules/core/include/opencv2/core/cv_cpu_dispatch.h b/modules/core/include/opencv2/core/cv_cpu_dispatch.h
+new file mode 100644
+index 000000000..9a8537f90
+--- /dev/null
++++ b/modules/core/include/opencv2/core/cv_cpu_dispatch.h
+@@ -0,0 +1,166 @@
++// This file is part of OpenCV project.
++// It is subject to the license terms in the LICENSE file found in the top-level directory
++// of this distribution and at http://opencv.org/license.html.
++
++#if defined __OPENCV_BUILD \
++
++#include "cv_cpu_config.h"
++#include "cv_cpu_helper.h"
++
++#if defined CV_ENABLE_INTRINSICS \
++ && !defined CV_DISABLE_OPTIMIZATION \
++ && !defined __CUDACC__ /* do not include SSE/AVX/NEON headers for NVCC compiler */ \
++
++#ifdef CV_CPU_COMPILE_SSE2
++# include <emmintrin.h>
++# define CV_MMX 1
++# define CV_SSE 1
++# define CV_SSE2 1
++#endif
++#ifdef CV_CPU_COMPILE_SSE3
++# include <pmmintrin.h>
++# define CV_SSE3 1
++#endif
++#ifdef CV_CPU_COMPILE_SSSE3
++# include <tmmintrin.h>
++# define CV_SSSE3 1
++#endif
++#ifdef CV_CPU_COMPILE_SSE4_1
++# include <smmintrin.h>
++# define CV_SSE4_1 1
++#endif
++#ifdef CV_CPU_COMPILE_SSE4_2
++# include <nmmintrin.h>
++# define CV_SSE4_2 1
++#endif
++#ifdef CV_CPU_COMPILE_POPCNT
++# ifdef _MSC_VER
++# include <nmmintrin.h>
++# if defined(_M_X64)
++# define CV_POPCNT_U64 _mm_popcnt_u64
++# endif
++# define CV_POPCNT_U32 _mm_popcnt_u32
++# else
++# include <popcntintrin.h>
++# if defined(__x86_64__)
++# define CV_POPCNT_U64 __builtin_popcountll
++# endif
++# define CV_POPCNT_U32 __builtin_popcount
++# endif
++# define CV_POPCNT 1
++#endif
++#ifdef CV_CPU_COMPILE_AVX
++# include <immintrin.h>
++# define CV_AVX 1
++#endif
++#ifdef CV_CPU_COMPILE_AVX2
++# include <immintrin.h>
++# define CV_AVX2 1
++#endif
++#ifdef CV_CPU_COMPILE_FMA3
++# define CV_FMA3 1
++#endif
++
++#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)
++# include <Intrin.h>
++# include <arm_neon.h>
++# define CV_NEON 1
++#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))
++# include <arm_neon.h>
++# define CV_NEON 1
++#endif
++
++#if defined(__ARM_NEON__) || defined(__aarch64__)
++# include <arm_neon.h>
++#endif
++
++#endif // CV_ENABLE_INTRINSICS && !CV_DISABLE_OPTIMIZATION && !__CUDACC__
++
++#endif // __OPENCV_BUILD
++
++
++
++#if !defined __OPENCV_BUILD // Compatibility code
++
++#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
++# include <emmintrin.h>
++# define CV_MMX 1
++# define CV_SSE 1
++# define CV_SSE2 1
++#elif (defined WIN32 || defined _WIN32) && defined(_M_ARM)
++# include <Intrin.h>
++# include <arm_neon.h>
++# define CV_NEON 1
++#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))
++# include <arm_neon.h>
++# define CV_NEON 1
++#endif
++
++#endif // !__OPENCV_BUILD (Compatibility code)
++
++
++
++#ifndef CV_MMX
++# define CV_MMX 0
++#endif
++#ifndef CV_SSE
++# define CV_SSE 0
++#endif
++#ifndef CV_SSE2
++# define CV_SSE2 0
++#endif
++#ifndef CV_SSE3
++# define CV_SSE3 0
++#endif
++#ifndef CV_SSSE3
++# define CV_SSSE3 0
++#endif
++#ifndef CV_SSE4_1
++# define CV_SSE4_1 0
++#endif
++#ifndef CV_SSE4_2
++# define CV_SSE4_2 0
++#endif
++#ifndef CV_POPCNT
++# define CV_POPCNT 0
++#endif
++#ifndef CV_AVX
++# define CV_AVX 0
++#endif
++#ifndef CV_AVX2
++# define CV_AVX2 0
++#endif
++#ifndef CV_FMA3
++# define CV_FMA3 0
++#endif
++#ifndef CV_AVX_512F
++# define CV_AVX_512F 0
++#endif
++#ifndef CV_AVX_512BW
++# define CV_AVX_512BW 0
++#endif
++#ifndef CV_AVX_512CD
++# define CV_AVX_512CD 0
++#endif
++#ifndef CV_AVX_512DQ
++# define CV_AVX_512DQ 0
++#endif
++#ifndef CV_AVX_512ER
++# define CV_AVX_512ER 0
++#endif
++#ifndef CV_AVX_512IFMA512
++# define CV_AVX_512IFMA512 0
++#endif
++#ifndef CV_AVX_512PF
++# define CV_AVX_512PF 0
++#endif
++#ifndef CV_AVX_512VBMI
++# define CV_AVX_512VBMI 0
++#endif
++#ifndef CV_AVX_512VL
++# define CV_AVX_512VL 0
++#endif
++
++#ifndef CV_NEON
++# define CV_NEON 0
++#endif
+diff --git a/modules/core/include/opencv2/core/cv_cpu_helper.h b/modules/core/include/opencv2/core/cv_cpu_helper.h
+new file mode 100644
+index 000000000..cb755d615
+--- /dev/null
++++ b/modules/core/include/opencv2/core/cv_cpu_helper.h
+@@ -0,0 +1,133 @@
++// AUTOGENERATED, DO NOT EDIT
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE
++# define CV_CPU_HAS_SUPPORT_SSE 1
++# define CV_CPU_CALL_SSE(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE
++# define CV_CPU_HAS_SUPPORT_SSE (cv::checkHardwareSupport(CV_CPU_SSE))
++# define CV_CPU_CALL_SSE(...) if (CV_CPU_HAS_SUPPORT_SSE) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSE 0
++# define CV_CPU_CALL_SSE(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE2
++# define CV_CPU_HAS_SUPPORT_SSE2 1
++# define CV_CPU_CALL_SSE2(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE2
++# define CV_CPU_HAS_SUPPORT_SSE2 (cv::checkHardwareSupport(CV_CPU_SSE2))
++# define CV_CPU_CALL_SSE2(...) if (CV_CPU_HAS_SUPPORT_SSE2) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSE2 0
++# define CV_CPU_CALL_SSE2(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE3
++# define CV_CPU_HAS_SUPPORT_SSE3 1
++# define CV_CPU_CALL_SSE3(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE3
++# define CV_CPU_HAS_SUPPORT_SSE3 (cv::checkHardwareSupport(CV_CPU_SSE3))
++# define CV_CPU_CALL_SSE3(...) if (CV_CPU_HAS_SUPPORT_SSE3) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSE3 0
++# define CV_CPU_CALL_SSE3(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSSE3
++# define CV_CPU_HAS_SUPPORT_SSSE3 1
++# define CV_CPU_CALL_SSSE3(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSSE3
++# define CV_CPU_HAS_SUPPORT_SSSE3 (cv::checkHardwareSupport(CV_CPU_SSSE3))
++# define CV_CPU_CALL_SSSE3(...) if (CV_CPU_HAS_SUPPORT_SSSE3) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSSE3 0
++# define CV_CPU_CALL_SSSE3(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_1
++# define CV_CPU_HAS_SUPPORT_SSE4_1 1
++# define CV_CPU_CALL_SSE4_1(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_1
++# define CV_CPU_HAS_SUPPORT_SSE4_1 (cv::checkHardwareSupport(CV_CPU_SSE4_1))
++# define CV_CPU_CALL_SSE4_1(...) if (CV_CPU_HAS_SUPPORT_SSE4_1) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSE4_1 0
++# define CV_CPU_CALL_SSE4_1(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_SSE4_2
++# define CV_CPU_HAS_SUPPORT_SSE4_2 1
++# define CV_CPU_CALL_SSE4_2(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_SSE4_2
++# define CV_CPU_HAS_SUPPORT_SSE4_2 (cv::checkHardwareSupport(CV_CPU_SSE4_2))
++# define CV_CPU_CALL_SSE4_2(...) if (CV_CPU_HAS_SUPPORT_SSE4_2) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_SSE4_2 0
++# define CV_CPU_CALL_SSE4_2(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_POPCNT
++# define CV_CPU_HAS_SUPPORT_POPCNT 1
++# define CV_CPU_CALL_POPCNT(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_POPCNT
++# define CV_CPU_HAS_SUPPORT_POPCNT (cv::checkHardwareSupport(CV_CPU_POPCNT))
++# define CV_CPU_CALL_POPCNT(...) if (CV_CPU_HAS_SUPPORT_POPCNT) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_POPCNT 0
++# define CV_CPU_CALL_POPCNT(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX
++# define CV_CPU_HAS_SUPPORT_AVX 1
++# define CV_CPU_CALL_AVX(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX
++# define CV_CPU_HAS_SUPPORT_AVX (cv::checkHardwareSupport(CV_CPU_AVX))
++# define CV_CPU_CALL_AVX(...) if (CV_CPU_HAS_SUPPORT_AVX) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_AVX 0
++# define CV_CPU_CALL_AVX(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FP16
++# define CV_CPU_HAS_SUPPORT_FP16 1
++# define CV_CPU_CALL_FP16(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FP16
++# define CV_CPU_HAS_SUPPORT_FP16 (cv::checkHardwareSupport(CV_CPU_FP16))
++# define CV_CPU_CALL_FP16(...) if (CV_CPU_HAS_SUPPORT_FP16) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_FP16 0
++# define CV_CPU_CALL_FP16(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX2
++# define CV_CPU_HAS_SUPPORT_AVX2 1
++# define CV_CPU_CALL_AVX2(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX2
++# define CV_CPU_HAS_SUPPORT_AVX2 (cv::checkHardwareSupport(CV_CPU_AVX2))
++# define CV_CPU_CALL_AVX2(...) if (CV_CPU_HAS_SUPPORT_AVX2) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_AVX2 0
++# define CV_CPU_CALL_AVX2(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_FMA3
++# define CV_CPU_HAS_SUPPORT_FMA3 1
++# define CV_CPU_CALL_FMA3(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_FMA3
++# define CV_CPU_HAS_SUPPORT_FMA3 (cv::checkHardwareSupport(CV_CPU_FMA3))
++# define CV_CPU_CALL_FMA3(...) if (CV_CPU_HAS_SUPPORT_FMA3) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_FMA3 0
++# define CV_CPU_CALL_FMA3(...)
++#endif
++
++#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_NEON
++# define CV_CPU_HAS_SUPPORT_NEON 1
++# define CV_CPU_CALL_NEON(...) return __VA_ARGS__
++#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_NEON
++# define CV_CPU_HAS_SUPPORT_NEON (cv::checkHardwareSupport(CV_CPU_NEON))
++# define CV_CPU_CALL_NEON(...) if (CV_CPU_HAS_SUPPORT_NEON) return __VA_ARGS__
++#else
++# define CV_CPU_HAS_SUPPORT_NEON 0
++# define CV_CPU_CALL_NEON(...)
++#endif
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index 699b1667b..0a46e0236 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -48,6 +48,10 @@
+ //! @addtogroup core_utils
+ //! @{
+
++#ifdef __OPENCV_BUILD
++#include "cvconfig.h"
++#endif
++
+ #if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER && _MSC_VER > 1300
+ # define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio warnings */
+ #endif
+@@ -59,10 +63,6 @@
+ #undef abs
+ #undef Complex
+
+-#if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER && _MSC_VER > 1300
+-# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio warnings */
+-#endif
+-
+ #include <limits.h>
+ #include "opencv2/core/hal/interface.h"
+
+@@ -88,7 +88,7 @@
+ # endif
+ #endif
+
+-#if defined CV_ICC && !defined CV_ENABLE_UNROLLED
++#if defined CV_DISABLE_OPTIMIZATION || (defined CV_ICC && !defined CV_ENABLE_UNROLLED)
+ # define CV_ENABLE_UNROLLED 0
+ #else
+ # define CV_ENABLE_UNROLLED 1
+@@ -161,142 +161,9 @@ enum CpuFeatures {
+ CPU_NEON = 100
+ };
+
+-// do not include SSE/AVX/NEON headers for NVCC compiler
+-#ifndef __CUDACC__
+-
+-#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2)
+-# include <emmintrin.h>
+-# define CV_MMX 1
+-# define CV_SSE 1
+-# define CV_SSE2 1
+-# if defined __SSE3__ || (defined _MSC_VER && _MSC_VER >= 1500)
+-# include <pmmintrin.h>
+-# define CV_SSE3 1
+-# endif
+-# if defined __SSSE3__ || (defined _MSC_VER && _MSC_VER >= 1500)
+-# include <tmmintrin.h>
+-# define CV_SSSE3 1
+-# endif
+-# if defined __SSE4_1__ || (defined _MSC_VER && _MSC_VER >= 1500)
+-# include <smmintrin.h>
+-# define CV_SSE4_1 1
+-# endif
+-# if defined __SSE4_2__ || (defined _MSC_VER && _MSC_VER >= 1500)
+-# include <nmmintrin.h>
+-# define CV_SSE4_2 1
+-# endif
+-# if defined __POPCNT__ || (defined _MSC_VER && _MSC_VER >= 1500)
+-# ifdef _MSC_VER
+-# include <nmmintrin.h>
+-# else
+-# include <popcntintrin.h>
+-# endif
+-# define CV_POPCNT 1
+-# endif
+-# if defined __AVX__ || (defined _MSC_VER && _MSC_VER >= 1600 && 0)
+-// MS Visual Studio 2010 (2012?) has no macro pre-defined to identify the use of /arch:AVX
+-// See: http://connect.microsoft.com/VisualStudio/feedback/details/605858/arch-avx-should-define-a-predefined-macro-in-x64-and-set-a-unique-value-for-m-ix86-fp-in-win32
+-# include <immintrin.h>
+-# define CV_AVX 1
+-# if defined(_XCR_XFEATURE_ENABLED_MASK)
+-# define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK)
+-# else
+-# define __xgetbv() 0
+-# endif
+-# endif
+-# if defined __AVX2__ || (defined _MSC_VER && _MSC_VER >= 1800 && 0)
+-# include <immintrin.h>
+-# define CV_AVX2 1
+-# if defined __FMA__
+-# define CV_FMA3 1
+-# endif
+-# endif
+-#endif
+-
+-#if (defined WIN32 || defined _WIN32) && defined(_M_ARM)
+-# include <Intrin.h>
+-# include <arm_neon.h>
+-# define CV_NEON 1
+-# define CPU_HAS_NEON_FEATURE (true)
+-#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__))
+-# include <arm_neon.h>
+-# define CV_NEON 1
+-#endif
+-
+-#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__
+-# define CV_VFP 1
+-#endif
+-
+-#endif // __CUDACC__
+-
+-#ifndef CV_POPCNT
+-#define CV_POPCNT 0
+-#endif
+-#ifndef CV_MMX
+-# define CV_MMX 0
+-#endif
+-#ifndef CV_SSE
+-# define CV_SSE 0
+-#endif
+-#ifndef CV_SSE2
+-# define CV_SSE2 0
+-#endif
+-#ifndef CV_SSE3
+-# define CV_SSE3 0
+-#endif
+-#ifndef CV_SSSE3
+-# define CV_SSSE3 0
+-#endif
+-#ifndef CV_SSE4_1
+-# define CV_SSE4_1 0
+-#endif
+-#ifndef CV_SSE4_2
+-# define CV_SSE4_2 0
+-#endif
+-#ifndef CV_AVX
+-# define CV_AVX 0
+-#endif
+-#ifndef CV_AVX2
+-# define CV_AVX2 0
+-#endif
+-#ifndef CV_FMA3
+-# define CV_FMA3 0
+-#endif
+-#ifndef CV_AVX_512F
+-# define CV_AVX_512F 0
+-#endif
+-#ifndef CV_AVX_512BW
+-# define CV_AVX_512BW 0
+-#endif
+-#ifndef CV_AVX_512CD
+-# define CV_AVX_512CD 0
+-#endif
+-#ifndef CV_AVX_512DQ
+-# define CV_AVX_512DQ 0
+-#endif
+-#ifndef CV_AVX_512ER
+-# define CV_AVX_512ER 0
+-#endif
+-#ifndef CV_AVX_512IFMA512
+-# define CV_AVX_512IFMA512 0
+-#endif
+-#ifndef CV_AVX_512PF
+-# define CV_AVX_512PF 0
+-#endif
+-#ifndef CV_AVX_512VBMI
+-# define CV_AVX_512VBMI 0
+-#endif
+-#ifndef CV_AVX_512VL
+-# define CV_AVX_512VL 0
+-#endif
+
+-#ifndef CV_NEON
+-# define CV_NEON 0
+-#endif
++#include "cv_cpu_dispatch.h"
+
+-#ifndef CV_VFP
+-# define CV_VFP 0
+-#endif
+
+ /* fundamental constants */
+ #define CV_PI 3.1415926535897932384626433832795
+diff --git a/modules/core/include/opencv2/core/fast_math.hpp b/modules/core/include/opencv2/core/fast_math.hpp
+index c76936afe..31c106232 100644
+--- a/modules/core/include/opencv2/core/fast_math.hpp
++++ b/modules/core/include/opencv2/core/fast_math.hpp
+@@ -47,6 +47,12 @@
+
+ #include "opencv2/core/cvdef.h"
+
++#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
++ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
++#include <emmintrin.h>
++#endif
++
++
+ //! @addtogroup core_utils
+ //! @{
+
+@@ -66,7 +72,7 @@
+ # include "tegra_round.hpp"
+ #endif
+
+-#if CV_VFP
++#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__
+ // 1. general scheme
+ #define ARM_ROUND(_value, _asm_string) \
+ int res; \
+@@ -82,7 +88,7 @@
+ #endif
+ // 3. version for float
+ #define ARM_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]")
+-#endif // CV_VFP
++#endif
+
+ /** @brief Rounds floating-point number to the nearest integer
+
+@@ -93,7 +99,7 @@ CV_INLINE int
+ cvRound( double value )
+ {
+ #if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
+- && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
++ && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__)
+ __m128d t = _mm_set_sd( value );
+ return _mm_cvtsd_si32(t);
+ #elif defined _MSC_VER && defined _M_IX86
+@@ -108,7 +114,7 @@ cvRound( double value )
+ defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION
+ TEGRA_ROUND_DBL(value);
+ #elif defined CV_ICC || defined __GNUC__
+-# if CV_VFP
++# if defined ARM_ROUND_DBL
+ ARM_ROUND_DBL(value);
+ # else
+ return (int)lrint(value);
+@@ -130,18 +136,8 @@ cvRound( double value )
+ */
+ CV_INLINE int cvFloor( double value )
+ {
+-#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
+- __m128d t = _mm_set_sd( value );
+- int i = _mm_cvtsd_si32(t);
+- return i - _mm_movemask_pd(_mm_cmplt_sd(t, _mm_cvtsi32_sd(t,i)));
+-#elif defined __GNUC__
+ int i = (int)value;
+ return i - (i > value);
+-#else
+- int i = cvRound(value);
+- float diff = (float)(value - i);
+- return i - (diff < 0);
+-#endif
+ }
+
+ /** @brief Rounds floating-point number to the nearest integer not smaller than the original.
+@@ -153,18 +149,8 @@ CV_INLINE int cvFloor( double value )
+ */
+ CV_INLINE int cvCeil( double value )
+ {
+-#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)) && !defined(__CUDACC__)
+- __m128d t = _mm_set_sd( value );
+- int i = _mm_cvtsd_si32(t);
+- return i + _mm_movemask_pd(_mm_cmplt_sd(_mm_cvtsi32_sd(t,i), t));
+-#elif defined __GNUC__
+ int i = (int)value;
+ return i + (i < value);
+-#else
+- int i = cvRound(value);
+- float diff = (float)(i - value);
+- return i + (diff < 0);
+-#endif
+ }
+
+ /** @brief Determines if the argument is Not A Number.
+@@ -200,8 +186,8 @@ CV_INLINE int cvIsInf( double value )
+ /** @overload */
+ CV_INLINE int cvRound(float value)
+ {
+-#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ && \
+- defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
++#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \
++ && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__)
+ __m128 t = _mm_set_ss( value );
+ return _mm_cvtss_si32(t);
+ #elif defined _MSC_VER && defined _M_IX86
+@@ -216,7 +202,7 @@ CV_INLINE int cvRound(float value)
+ defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION
+ TEGRA_ROUND_FLT(value);
+ #elif defined CV_ICC || defined __GNUC__
+-# if CV_VFP
++# if defined ARM_ROUND_FLT
+ ARM_ROUND_FLT(value);
+ # else
+ return (int)lrintf(value);
+@@ -237,18 +223,8 @@ CV_INLINE int cvRound( int value )
+ /** @overload */
+ CV_INLINE int cvFloor( float value )
+ {
+-#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__)
+- __m128 t = _mm_set_ss( value );
+- int i = _mm_cvtss_si32(t);
+- return i - _mm_movemask_ps(_mm_cmplt_ss(t, _mm_cvtsi32_ss(t,i)));
+-#elif defined __GNUC__
+ int i = (int)value;
+ return i - (i > value);
+-#else
+- int i = cvRound(value);
+- float diff = (float)(value - i);
+- return i - (diff < 0);
+-#endif
+ }
+
+ /** @overload */
+@@ -260,18 +236,8 @@ CV_INLINE int cvFloor( int value )
+ /** @overload */
+ CV_INLINE int cvCeil( float value )
+ {
+-#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)) && !defined(__CUDACC__)
+- __m128 t = _mm_set_ss( value );
+- int i = _mm_cvtss_si32(t);
+- return i + _mm_movemask_ps(_mm_cmplt_ss(_mm_cvtsi32_ss(t,i), t));
+-#elif defined __GNUC__
+ int i = (int)value;
+ return i + (i < value);
+-#else
+- int i = cvRound(value);
+- float diff = (float)(i - value);
+- return i + (diff < 0);
+-#endif
+ }
+
+ /** @overload */
+diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
+index 3c8f39d74..a9838382f 100644
+--- a/modules/core/src/system.cpp
++++ b/modules/core/src/system.cpp
+@@ -237,24 +237,81 @@ void Exception::formatMessage()
+ msg = format("%s:%d: error: (%d) %s\n", file.c_str(), line, code, err.c_str());
+ }
+
++static const char* g_hwFeatureNames[CV_HARDWARE_MAX_FEATURE] = { NULL };
++
++static const char* getHWFeatureName(int id)
++{
++ return (id < CV_HARDWARE_MAX_FEATURE) ? g_hwFeatureNames[id] : NULL;
++}
++static const char* getHWFeatureNameSafe(int id)
++{
++ const char* name = getHWFeatureName(id);
++ return name ? name : "Unknown feature";
++}
++
+ struct HWFeatures
+ {
+ enum { MAX_FEATURE = CV_HARDWARE_MAX_FEATURE };
+
+- HWFeatures(void)
++ HWFeatures(bool run_initialize = false)
+ {
+- memset( have, 0, sizeof(have) );
+- x86_family = 0;
++ memset( have, 0, sizeof(have[0]) * MAX_FEATURE );
++ if (run_initialize)
++ initialize();
+ }
+
+- static HWFeatures initialize(void)
++ static void initializeNames()
+ {
+- HWFeatures f;
++ for (int i = 0; i < CV_HARDWARE_MAX_FEATURE; i++)
++ {
++ g_hwFeatureNames[i] = 0;
++ }
++ g_hwFeatureNames[CPU_MMX] = "MMX";
++ g_hwFeatureNames[CPU_SSE] = "SSE";
++ g_hwFeatureNames[CPU_SSE2] = "SSE2";
++ g_hwFeatureNames[CPU_SSE3] = "SSE3";
++ g_hwFeatureNames[CPU_SSSE3] = "SSSE3";
++ g_hwFeatureNames[CPU_SSE4_1] = "SSE4.1";
++ g_hwFeatureNames[CPU_SSE4_2] = "SSE4.2";
++ g_hwFeatureNames[CPU_POPCNT] = "POPCNT";
++ g_hwFeatureNames[CPU_FP16] = "FP16";
++ g_hwFeatureNames[CPU_AVX] = "AVX";
++ g_hwFeatureNames[CPU_AVX2] = "AVX2";
++ g_hwFeatureNames[CPU_FMA3] = "FMA3";
++
++ g_hwFeatureNames[CPU_AVX_512F] = "AVX512F";
++ g_hwFeatureNames[CPU_AVX_512BW] = "AVX512BW";
++ g_hwFeatureNames[CPU_AVX_512CD] = "AVX512CD";
++ g_hwFeatureNames[CPU_AVX_512DQ] = "AVX512DQ";
++ g_hwFeatureNames[CPU_AVX_512ER] = "AVX512ER";
++ g_hwFeatureNames[CPU_AVX_512IFMA512] = "AVX512IFMA";
++ g_hwFeatureNames[CPU_AVX_512PF] = "AVX512PF";
++ g_hwFeatureNames[CPU_AVX_512VBMI] = "AVX512VBMI";
++ g_hwFeatureNames[CPU_AVX_512VL] = "AVX512VL";
++
++ g_hwFeatureNames[CPU_NEON] = "NEON";
++ }
++
++ void initialize(void)
++ {
++#ifndef WINRT
++ if (getenv("OPENCV_DUMP_CONFIG"))
++ {
++ fprintf(stderr, "\nOpenCV build configuration is:\n%s\n",
++ cv::getBuildInformation().c_str());
++ }
++#endif
++
++ initializeNames();
++
+ int cpuid_data[4] = { 0, 0, 0, 0 };
++ int cpuid_data_ex[4] = { 0, 0, 0, 0 };
+
+ #if defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
++ #define OPENCV_HAVE_X86_CPUID 1
+ __cpuid(cpuid_data, 1);
+ #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++ #define OPENCV_HAVE_X86_CPUID 1
+ #ifdef __x86_64__
+ asm __volatile__
+ (
+@@ -278,33 +335,36 @@ struct HWFeatures
+ #endif
+ #endif
+
+- f.x86_family = (cpuid_data[0] >> 8) & 15;
+- if( f.x86_family >= 6 )
++ #ifdef OPENCV_HAVE_X86_CPUID
++ int x86_family = (cpuid_data[0] >> 8) & 15;
++ if( x86_family >= 6 )
+ {
+- f.have[CV_CPU_MMX] = (cpuid_data[3] & (1 << 23)) != 0;
+- f.have[CV_CPU_SSE] = (cpuid_data[3] & (1<<25)) != 0;
+- f.have[CV_CPU_SSE2] = (cpuid_data[3] & (1<<26)) != 0;
+- f.have[CV_CPU_SSE3] = (cpuid_data[2] & (1<<0)) != 0;
+- f.have[CV_CPU_SSSE3] = (cpuid_data[2] & (1<<9)) != 0;
+- f.have[CV_CPU_FMA3] = (cpuid_data[2] & (1<<12)) != 0;
+- f.have[CV_CPU_SSE4_1] = (cpuid_data[2] & (1<<19)) != 0;
+- f.have[CV_CPU_SSE4_2] = (cpuid_data[2] & (1<<20)) != 0;
+- f.have[CV_CPU_POPCNT] = (cpuid_data[2] & (1<<23)) != 0;
+- f.have[CV_CPU_AVX] = (((cpuid_data[2] & (1<<28)) != 0)&&((cpuid_data[2] & (1<<27)) != 0));//OS uses XSAVE_XRSTORE and CPU support AVX
+- f.have[CV_CPU_FP16] = (cpuid_data[2] & (1<<29)) != 0;
++ have[CV_CPU_MMX] = (cpuid_data[3] & (1<<23)) != 0;
++ have[CV_CPU_SSE] = (cpuid_data[3] & (1<<25)) != 0;
++ have[CV_CPU_SSE2] = (cpuid_data[3] & (1<<26)) != 0;
++ have[CV_CPU_SSE3] = (cpuid_data[2] & (1<<0)) != 0;
++ have[CV_CPU_SSSE3] = (cpuid_data[2] & (1<<9)) != 0;
++ have[CV_CPU_FMA3] = (cpuid_data[2] & (1<<12)) != 0;
++ have[CV_CPU_SSE4_1] = (cpuid_data[2] & (1<<19)) != 0;
++ have[CV_CPU_SSE4_2] = (cpuid_data[2] & (1<<20)) != 0;
++ have[CV_CPU_POPCNT] = (cpuid_data[2] & (1<<23)) != 0;
++ have[CV_CPU_AVX] = (cpuid_data[2] & (1<<28)) != 0;
++ have[CV_CPU_FP16] = (cpuid_data[2] & (1<<29)) != 0;
+
+ // make the second call to the cpuid command in order to get
+ // information about extended features like AVX2
+ #if defined _MSC_VER && (defined _M_IX86 || defined _M_X64)
+- __cpuidex(cpuid_data, 7, 0);
++ #define OPENCV_HAVE_X86_CPUID_EX 1
++ __cpuidex(cpuid_data_ex, 7, 0);
+ #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++ #define OPENCV_HAVE_X86_CPUID_EX 1
+ #ifdef __x86_64__
+ asm __volatile__
+ (
+ "movl $7, %%eax\n\t"
+ "movl $0, %%ecx\n\t"
+ "cpuid\n\t"
+- :[eax]"=a"(cpuid_data[0]),[ebx]"=b"(cpuid_data[1]),[ecx]"=c"(cpuid_data[2]),[edx]"=d"(cpuid_data[3])
++ :[eax]"=a"(cpuid_data_ex[0]),[ebx]"=b"(cpuid_data_ex[1]),[ecx]"=c"(cpuid_data_ex[2]),[edx]"=d"(cpuid_data_ex[3])
+ :
+ : "cc"
+ );
+@@ -317,29 +377,76 @@ struct HWFeatures
+ "cpuid\n\t"
+ "movl %%ebx, %0\n\t"
+ "popl %%ebx\n\t"
+- : "=r"(cpuid_data[1]), "=c"(cpuid_data[2])
++ : "=r"(cpuid_data_ex[1]), "=c"(cpuid_data_ex[2])
+ :
+ : "cc"
+ );
+ #endif
+ #endif
+- f.have[CV_CPU_AVX2] = (cpuid_data[1] & (1<<5)) != 0;
+-
+- f.have[CV_CPU_AVX_512F] = (cpuid_data[1] & (1<<16)) != 0;
+- f.have[CV_CPU_AVX_512DQ] = (cpuid_data[1] & (1<<17)) != 0;
+- f.have[CV_CPU_AVX_512IFMA512] = (cpuid_data[1] & (1<<21)) != 0;
+- f.have[CV_CPU_AVX_512PF] = (cpuid_data[1] & (1<<26)) != 0;
+- f.have[CV_CPU_AVX_512ER] = (cpuid_data[1] & (1<<27)) != 0;
+- f.have[CV_CPU_AVX_512CD] = (cpuid_data[1] & (1<<28)) != 0;
+- f.have[CV_CPU_AVX_512BW] = (cpuid_data[1] & (1<<30)) != 0;
+- f.have[CV_CPU_AVX_512VL] = (cpuid_data[1] & (1<<31)) != 0;
+- f.have[CV_CPU_AVX_512VBMI] = (cpuid_data[2] & (1<<1)) != 0;
++
++ #ifdef OPENCV_HAVE_X86_CPUID_EX
++ have[CV_CPU_AVX2] = (cpuid_data_ex[1] & (1<<5)) != 0;
++
++ have[CV_CPU_AVX_512F] = (cpuid_data_ex[1] & (1<<16)) != 0;
++ have[CV_CPU_AVX_512DQ] = (cpuid_data_ex[1] & (1<<17)) != 0;
++ have[CV_CPU_AVX_512IFMA512] = (cpuid_data_ex[1] & (1<<21)) != 0;
++ have[CV_CPU_AVX_512PF] = (cpuid_data_ex[1] & (1<<26)) != 0;
++ have[CV_CPU_AVX_512ER] = (cpuid_data_ex[1] & (1<<27)) != 0;
++ have[CV_CPU_AVX_512CD] = (cpuid_data_ex[1] & (1<<28)) != 0;
++ have[CV_CPU_AVX_512BW] = (cpuid_data_ex[1] & (1<<30)) != 0;
++ have[CV_CPU_AVX_512VL] = (cpuid_data_ex[1] & (1<<31)) != 0;
++ have[CV_CPU_AVX_512VBMI] = (cpuid_data_ex[2] & (1<<1)) != 0;
++ #else
++ CV_UNUSED(cpuid_data_ex);
++ #endif
++
++ bool have_AVX_OS_support = true;
++ bool have_AVX512_OS_support = true;
++ if (!(cpuid_data[2] & (1<<27)))
++ have_AVX_OS_support = false; // OS uses XSAVE_XRSTORE and CPU support AVX
++ else
++ {
++ int xcr0 = 0;
++ #ifdef _XCR_XFEATURE_ENABLED_MASK // requires immintrin.h
++ xcr0 = (int)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);
++ #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++ __asm__ ("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx" );
++ #endif
++ if ((xcr0 & 0x6) != 0x6)
++ have_AVX_OS_support = false; // YMM registers
++ if ((xcr0 & 0xe6) != 0xe6)
++ have_AVX512_OS_support = false; // ZMM registers
++ }
++
++ if (!have_AVX_OS_support)
++ {
++ have[CV_CPU_AVX] = false;
++ have[CV_CPU_FP16] = false;
++ have[CV_CPU_AVX2] = false;
++ have[CV_CPU_FMA3] = false;
++ }
++ if (!have_AVX_OS_support || !have_AVX512_OS_support)
++ {
++ have[CV_CPU_AVX_512F] = false;
++ have[CV_CPU_AVX_512BW] = false;
++ have[CV_CPU_AVX_512CD] = false;
++ have[CV_CPU_AVX_512DQ] = false;
++ have[CV_CPU_AVX_512ER] = false;
++ have[CV_CPU_AVX_512IFMA512] = false;
++ have[CV_CPU_AVX_512PF] = false;
++ have[CV_CPU_AVX_512VBMI] = false;
++ have[CV_CPU_AVX_512VL] = false;
++ }
+ }
++ #else
++ CV_UNUSED(cpuid_data);
++ CV_UNUSED(cpuid_data_ex);
++ #endif // OPENCV_HAVE_X86_CPUID
+
+ #if defined ANDROID || defined __linux__
+ #ifdef __aarch64__
+- f.have[CV_CPU_NEON] = true;
+- f.have[CV_CPU_FP16] = true;
++ have[CV_CPU_NEON] = true;
++ have[CV_CPU_FP16] = true;
+ #elif defined __arm__
+ int cpufile = open("/proc/self/auxv", O_RDONLY);
+
+@@ -352,8 +459,8 @@ struct HWFeatures
+ {
+ if (auxv.a_type == AT_HWCAP)
+ {
+- f.have[CV_CPU_NEON] = (auxv.a_un.a_val & 4096) != 0;
+- f.have[CV_CPU_FP16] = (auxv.a_un.a_val & 2) != 0;
++ have[CV_CPU_NEON] = (auxv.a_un.a_val & 4096) != 0;
++ have[CV_CPU_FP16] = (auxv.a_un.a_val & 2) != 0;
+ break;
+ }
+ }
+@@ -363,21 +470,133 @@ struct HWFeatures
+ #endif
+ #elif (defined __clang__ || defined __APPLE__)
+ #if (defined __ARM_NEON__ || (defined __ARM_NEON && defined __aarch64__))
+- f.have[CV_CPU_NEON] = true;
++ have[CV_CPU_NEON] = true;
+ #endif
+ #if (defined __ARM_FP && (((__ARM_FP & 0x2) != 0) && defined __ARM_NEON__))
+- f.have[CV_CPU_FP16] = true;
++ have[CV_CPU_FP16] = true;
+ #endif
+ #endif
+
+- return f;
++ int baseline_features[] = { CV_CPU_BASELINE_FEATURES };
++ if (!checkFeatures(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0])))
++ {
++ fprintf(stderr, "\n"
++ "******************************************************************\n"
++ "* FATAL ERROR: *\n"
++ "* This OpenCV build doesn't support current CPU/HW configuration *\n"
++ "* *\n"
++ "* Use OPENCV_DUMP_CONFIG=1 environment variable for details *\n"
++ "******************************************************************\n");
++ fprintf(stderr, "\nRequired baseline features:\n");
++ checkFeatures(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]), true);
++ CV_ErrorNoReturn(cv::Error::StsAssert, "Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.");
++ }
++
++ readSettings(baseline_features, sizeof(baseline_features) / sizeof(baseline_features[0]));
++ }
++
++ bool checkFeatures(const int* features, int count, bool dump = false)
++ {
++ bool result = true;
++ for (int i = 0; i < count; i++)
++ {
++ int feature = features[i];
++ if (feature)
++ {
++ if (have[feature])
++ {
++ if (dump) fprintf(stderr, "%s - OK\n", getHWFeatureNameSafe(feature));
++ }
++ else
++ {
++ result = false;
++ if (dump) fprintf(stderr, "%s - NOT AVAILABLE\n", getHWFeatureNameSafe(feature));
++ }
++ }
++ }
++ return result;
++ }
++
++ static inline bool isSymbolSeparator(char c)
++ {
++ return c == ',' || c == ';' || c == '-';
++ }
++
++ void readSettings(const int* baseline_features, int baseline_count)
++ {
++ bool dump = true;
++ const char* disabled_features =
++#ifndef WINRT
++ getenv("OPENCV_CPU_DISABLE");
++#else
++ NULL;
++#endif
++ if (disabled_features && disabled_features[0] != 0)
++ {
++ const char* start = disabled_features;
++ for (;;)
++ {
++ while (start[0] != 0 && isSymbolSeparator(start[0]))
++ {
++ start++;
++ }
++ if (start[0] == 0)
++ break;
++ const char* end = start;
++ while (end[0] != 0 && !isSymbolSeparator(end[0]))
++ {
++ end++;
++ }
++ if (end == start)
++ continue;
++ cv::String feature(start, end);
++ start = end;
++
++ CV_Assert(feature.size() > 0);
++
++ bool found = false;
++ for (int i = 0; i < CV_HARDWARE_MAX_FEATURE; i++)
++ {
++ if (!g_hwFeatureNames[i]) continue;
++ size_t len = strlen(g_hwFeatureNames[i]);
++ if (len != feature.size()) continue;
++ if (feature.compare(g_hwFeatureNames[i]) == 0)
++ {
++ bool isBaseline = false;
++ for (int k = 0; k < baseline_count; k++)
++ {
++ if (baseline_features[k] == i)
++ {
++ isBaseline = true;
++ break;
++ }
++ }
++ if (isBaseline)
++ {
++ if (dump) fprintf(stderr, "OPENCV: Trying to disable baseline CPU feature: '%s'. This has very limited effect, because code optimizations for this feature are executed unconditionally in the most cases.\n", getHWFeatureNameSafe(i));
++ }
++ if (!have[i])
++ {
++ if (dump) fprintf(stderr, "OPENCV: Trying to disable unavailable CPU feature on the current platform: '%s'.\n", getHWFeatureNameSafe(i));
++ }
++ have[i] = false;
++
++ found = true;
++ break;
++ }
++ }
++ if (!found)
++ {
++ if (dump) fprintf(stderr, "OPENCV: Trying to disable unknown CPU feature: '%s'.\n", feature.c_str());
++ }
++ }
++ }
+ }
+
+- int x86_family;
+ bool have[MAX_FEATURE+1];
+ };
+
+-static HWFeatures featuresEnabled = HWFeatures::initialize(), featuresDisabled = HWFeatures();
++static HWFeatures featuresEnabled(true), featuresDisabled = HWFeatures(false);
+ static HWFeatures* currentFeatures = &featuresEnabled;
+
+ bool checkHardwareSupport(int feature)
+diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt
+index eb5617751..6d9c650bc 100644
+--- a/modules/highgui/CMakeLists.txt
++++ b/modules/highgui/CMakeLists.txt
+@@ -65,7 +65,7 @@ elseif(HAVE_QT)
+
+ list(APPEND HIGHGUI_LIBRARIES ${QT_LIBRARIES})
+ list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES})
+- ocv_check_flag_support(CXX -Wno-missing-declarations _have_flag)
++ ocv_check_flag_support(CXX -Wno-missing-declarations _have_flag "")
+ if(${_have_flag})
+ set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
+ endif()
+diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp
+index 0fa520228..dcf2e44b5 100644
+--- a/modules/imgproc/src/imgwarp.cpp
++++ b/modules/imgproc/src/imgwarp.cpp
+@@ -1649,7 +1649,7 @@ struct VResizeLanczos4
+ {
+ CastOp castOp;
+ VecOp vecOp;
+- int k, x = vecOp((const uchar**)src, (uchar*)dst, (const uchar*)beta, width);
++ int x = vecOp((const uchar**)src, (uchar*)dst, (const uchar*)beta, width);
+ #if CV_ENABLE_UNROLLED
+ for( ; x <= width - 4; x += 4 )
+ {
+@@ -1657,7 +1657,7 @@ struct VResizeLanczos4
+ const WT* S = src[0];
+ WT s0 = S[x]*b, s1 = S[x+1]*b, s2 = S[x+2]*b, s3 = S[x+3]*b;
+
+- for( k = 1; k < 8; k++ )
++ for( int k = 1; k < 8; k++ )
+ {
+ b = beta[k]; S = src[k];
+ s0 += S[x]*b; s1 += S[x+1]*b;
+diff --git a/modules/objdetect/src/haar.cpp b/modules/objdetect/src/haar.cpp
+index 51843fa48..bb37ee91e 100644
+--- a/modules/objdetect/src/haar.cpp
++++ b/modules/objdetect/src/haar.cpp
+@@ -824,10 +824,7 @@ cvRunHaarClassifierCascadeSum( const CvHaarClassifierCascade* _cascade,
+ CvPoint pt, double& stage_sum, int start_stage )
+ {
+ #ifdef CV_HAAR_USE_AVX
+- bool haveAVX = false;
+- if(cv::checkHardwareSupport(CV_CPU_AVX))
+- if(__xgetbv()&0x6)// Check if the OS will save the YMM registers
+- haveAVX = true;
++ bool haveAVX = cv::checkHardwareSupport(CV_CPU_AVX);
+ #else
+ # ifdef CV_HAAR_USE_SSE
+ bool haveSSE2 = cv::checkHardwareSupport(CV_CPU_SSE2);
+--
+2.12.2
+
diff --git a/package/opencv3/opencv3.mk b/package/opencv3/opencv3.mk
index 2e50ba244..153fd066a 100644
--- a/package/opencv3/opencv3.mk
+++ b/package/opencv3/opencv3.mk
@@ -97,22 +97,8 @@ OPENCV3_CONF_OPTS += \
#
# * PowerPC support is turned off since its only effect is altering CFLAGS,
# adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
-# * fma3 and popcnt support is disabled because according to gcc manual [2], it
-# is only available on x86_64 haswell, broadwell and knl architecture.
-#
-# [2] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/x86-Options.html#x86-Options
OPENCV3_CONF_OPTS += \
- -DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
- -DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
- -DENABLE_FMA3=OFF \
- -DENABLE_POPCNT=OFF \
- -DENABLE_POWERPC=OFF \
- -DENABLE_SSE=$(if $(BR2_X86_CPU_HAS_SSE),ON,OFF) \
- -DENABLE_SSE2=$(if $(BR2_X86_CPU_HAS_SSE2),ON,OFF) \
- -DENABLE_SSE3=$(if $(BR2_X86_CPU_HAS_SSE3),ON,OFF) \
- -DENABLE_SSE41=$(if $(BR2_X86_CPU_HAS_SSE4),ON,OFF) \
- -DENABLE_SSE42=$(if $(BR2_X86_CPU_HAS_SSE42),ON,OFF) \
- -DENABLE_SSSE3=$(if $(BR2_X86_CPU_HAS_SSSE3),ON,OFF)
+ -DENABLE_POWERPC=OFF
# Cuda stuff
OPENCV3_CONF_OPTS += \
--
2.12.2
^ permalink raw reply related
* [Buildroot] Conflict between uClibc-ng if_arp.h and kernel headers since Linux 4.11 ?
From: Thomas Petazzoni @ 2017-05-04 21:39 UTC (permalink / raw)
To: buildroot
Hello,
Since a few days, we are seeing build failures of the radvd package in
Buildroot:
http://autobuild.buildroot.net/?reason=radvd-2.12
The build failure is:
/home/buildroot/autobuild/run/instance-2/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/linux/if_arp.h:121:8: error: redefinition of 'struct arpreq_old'
struct arpreq_old {
^~~~~~~~~~
In file included from includes.h:90:0,
from recv.c:17:
/home/buildroot/autobuild/run/instance-2/output/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/net/if_arp.h:147:8: note: originally defined here
struct arpreq_old
^~~~~~~~~~
[...]
The build failures happens with uClibc-ng toolchains in combination
with Linux 4.11 kernel headers, so it seems to be a new thing caused by
Linux 4.11 headers. However the kernel Git history doesn't show any
change on this header file between 4.10 and 4.11.
Any idea?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [PATCH v3 1/2] cracklib: New package
From: Romain Naour @ 2017-05-04 21:34 UTC (permalink / raw)
To: buildroot
In-Reply-To: <1493881807.2302.3.camel@spectralink.com>
Hi Stefan, all,
Le 04/05/2017 ? 09:10, S?rensen, Stefan a ?crit :
> On Sun, 2017-04-30 at 15:36 +0200, Romain Naour wrote:
>
>> +ifeq ($(BR2_PACKAGE_CRACKLIB_TOOLS),)
>>> +define CRACKLIB_REMOVE_TOOLS
>>> + rm -f $(TARGET_DIR)/usr/sbin/*cracklib*
>>
>> Maybe this part can be done in a post install script instead ?
>
> Post install script? I can't find any reference to what that is.
Sorry, I meant post build scripts, see BR2_ROOTFS_POST_BUILD_SCRIPT option.
>
>>> + rm $(TARGET_DIR)/usr/share/cracklib/cracklib-small
>>
>> Why do you remove cracklib-small binary ?
>
> This is not a binary, but rather the source for the small dictionary.
> It is not needed on the target.
Ok, thanks for the explanation.
Best regards,
Romain
>
>
> Stefan
>
^ permalink raw reply
* [Buildroot] [PATCH] package/libunwind: disable for x86 with musl
From: Thomas Petazzoni @ 2017-05-04 21:23 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20170417173722.20719-1-romain.naour@gmail.com>
Hello,
On Mon, 17 Apr 2017 19:37:22 +0200, Romain Naour wrote:
> libunwind use sigreturn() and setcontext() while building for x86 [1]
> but this function is not available with musl [2].
>
> This throw a warning during libunwind build:
> In file included from x86/Los-linux.c:4:0:
> x86/Gos-linux.c: In function ?_ULx86_local_resume?:
> x86/Gos-linux.c:298:7: warning: implicit declaration of function ?sigreturn? [-Wimplicit-function-declaration]
> sigreturn (sc);
> ^
> But any program trying to link against libunwind-generic.so or
> libunwind.so fail to build:
> [...]/usr/lib/libunwind-generic.so: undefined reference to `sigreturn'
> [...]/usr/lib/libunwind-generic.so: undefined reference to `setcontext'
> collect2: error: ld returned 1 exit status
>
> Disable libunwind for x86 target when musl is used.
>
> Reported upstream by Waldemar [3]
>
> [1] http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/x86/Gos-linux.c;h=17aebc2974af50eb0bf8292689b2ed22a4c97866;hb=HEAD#l299
> [2] http://openwall.com/lists/musl/2016/02/04/3
> [3] http://lists.nongnu.org/archive/html/libunwind-devel/2017-04/msg00030.html
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Waldemar Brodkorb <wbx@openadk.org>
> ---
> Patch rebased after http://patchwork.ozlabs.org/patch/751402/
> ---
> package/libunwind/Config.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] package/libunwind: disable for x86 with musl
From: Thomas Petazzoni @ 2017-05-04 21:23 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=60aee0cc5afb85976ca3b346f82b2caadc3a1c21
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
libunwind use sigreturn() and setcontext() while building for x86 [1]
but this function is not available with musl [2].
This throw a warning during libunwind build:
In file included from x86/Los-linux.c:4:0:
x86/Gos-linux.c: In function ???_ULx86_local_resume???:
x86/Gos-linux.c:298:7: warning: implicit declaration of function ???sigreturn??? [-Wimplicit-function-declaration]
sigreturn (sc);
^
But any program trying to link against libunwind-generic.so or
libunwind.so fail to build:
[...]/usr/lib/libunwind-generic.so: undefined reference to `sigreturn'
[...]/usr/lib/libunwind-generic.so: undefined reference to `setcontext'
collect2: error: ld returned 1 exit status
Disable libunwind for x86 target when musl is used.
Reported upstream by Waldemar [3]
[1] http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=blob;f=src/x86/Gos-linux.c;h=17aebc2974af50eb0bf8292689b2ed22a4c97866;hb=HEAD#l299
[2] http://openwall.com/lists/musl/2016/02/04/3
[3] http://lists.nongnu.org/archive/html/libunwind-devel/2017-04/msg00030.html
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/libunwind/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/libunwind/Config.in b/package/libunwind/Config.in
index 2003e96..1a25317 100644
--- a/package/libunwind/Config.in
+++ b/package/libunwind/Config.in
@@ -16,7 +16,7 @@ config BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
(BR2_ARM_CPU_HAS_ARM || BR2_mips || BR2_mipsel || \
BR2_mips64 || BR2_mips64el || BR2_x86_64)
default y if BR2_TOOLCHAIN_USES_MUSL && \
- (BR2_ARM_CPU_HAS_ARM || BR2_i386 || BR2_x86_64)
+ (BR2_ARM_CPU_HAS_ARM || BR2_x86_64)
config BR2_PACKAGE_LIBUNWIND
bool "libunwind"
^ permalink raw reply related
* [Buildroot] [PATCH v3] package/aubio: bump to version 0.4.5
From: Thomas Petazzoni @ 2017-05-04 21:23 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20170417173322.19328-1-romain.naour@gmail.com>
Hello,
On Mon, 17 Apr 2017 19:33:22 +0200, Romain Naour wrote:
> Since aubio 0.4.4, the libsamplerate support require fftw
> single precision mode [1].
>
> [1] https://github.com/aubio/aubio/commit/8be88e77f5c275fdf4efc99ae182d14940948786
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
> v3: simply the libsamplerate dependency (ThomasP).
> v2: fix aubio version in the commit log.
> ---
> package/aubio/aubio.hash | 4 ++--
> package/aubio/aubio.mk | 5 +++--
> 2 files changed, 5 insertions(+), 4 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] package/aubio: bump to version 0.4.5
From: Thomas Petazzoni @ 2017-05-04 21:22 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=e8c044e1bd788d18410b981ff08635c4b2b9de4e
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
Since aubio 0.4.4, the libsamplerate support require fftw
single precision mode [1].
[1] https://github.com/aubio/aubio/commit/8be88e77f5c275fdf4efc99ae182d14940948786
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/aubio/aubio.hash | 4 ++--
package/aubio/aubio.mk | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/package/aubio/aubio.hash b/package/aubio/aubio.hash
index e447847..b4233ae 100644
--- a/package/aubio/aubio.hash
+++ b/package/aubio/aubio.hash
@@ -1,2 +1,2 @@
-# From https://aubio.org/pub/aubio-0.4.3.tar.bz2.sha256
-sha256 b62cdb073c0c64ae301917fa162969d42cba45e478bdf1e74490bd87e9cceaab aubio-0.4.3.tar.bz2
+# From https://aubio.org/pub/aubio-0.4.5.tar.bz2.sha256
+sha256 70c2804e6f4fbf0ebc0fb9ac8cc9d465ef4a4d438311c074c9a7364e98827af6 aubio-0.4.5.tar.bz2
diff --git a/package/aubio/aubio.mk b/package/aubio/aubio.mk
index f8be19f..2a09ebb 100644
--- a/package/aubio/aubio.mk
+++ b/package/aubio/aubio.mk
@@ -4,7 +4,7 @@
#
################################################################################
-AUBIO_VERSION = 0.4.3
+AUBIO_VERSION = 0.4.5
AUBIO_SITE = https://aubio.org/pub
AUBIO_SOURCE = aubio-$(AUBIO_VERSION).tar.bz2
AUBIO_LICENSE = GPL-3.0+
@@ -26,7 +26,8 @@ else
AUBIO_CONF_OPTS += --disable-sndfile
endif
-ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
+# Could not compile aubio in double precision mode with libsamplerate
+ifeq ($(BR2_PACKAGE_LIBSAMPLERATE)$(BR2_PACKAGE_FFTW_PRECISION_SINGLE),yy)
AUBIO_DEPENDENCIES += libsamplerate
AUBIO_CONF_OPTS += --enable-samplerate
else
^ permalink raw reply related
* [Buildroot] [PATCH] package/libunwind: simplify architectutre dependencies
From: Thomas Petazzoni @ 2017-05-04 21:22 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20170417164401.24236-1-yann.morin.1998@free.fr>
Hello,
On Mon, 17 Apr 2017 18:44:01 +0200, Yann E. MORIN wrote:
> BR2_ARM_CPU_HAS_ARM already embeddeds the fact that this is an ARM chip,
> so (BR2_arm || BR2_armeb) is forcibly true when BR2_ARM_CPU_HAS_ARM is.
>
> In other words, BR2_ARM_CPU_HAS_ARM can't be true unless either BR2_arm
> or BR2_armeb itslef is true.
>
> Simplify the logic accordingly.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Romain Naour <romain.naour@openwide.fr>
> ---
> package/libunwind/Config.in | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Applied to master, after fixing the typo in the commit title. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [Buildroot] [git commit] package/libunwind: simplify architecture dependencies
From: Thomas Petazzoni @ 2017-05-04 21:21 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=a84acbb4a7d7cf5feb43147839f04485e714b1a6
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
BR2_ARM_CPU_HAS_ARM already embeddeds the fact that this is an ARM chip,
so (BR2_arm || BR2_armeb) is forcibly true when BR2_ARM_CPU_HAS_ARM is.
In other words, BR2_ARM_CPU_HAS_ARM can't be true unless either BR2_arm
or BR2_armeb itslef is true.
Simplify the logic accordingly.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Romain Naour <romain.naour@openwide.fr>
Acked-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/libunwind/Config.in | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/package/libunwind/Config.in b/package/libunwind/Config.in
index 9007ce5..2003e96 100644
--- a/package/libunwind/Config.in
+++ b/package/libunwind/Config.in
@@ -10,16 +10,13 @@
config BR2_PACKAGE_LIBUNWIND_ARCH_SUPPORTS
bool
default y if BR2_TOOLCHAIN_USES_GLIBC && \
- (((BR2_arm || BR2_armeb) && BR2_ARM_CPU_HAS_ARM) || \
- BR2_mips || BR2_mipsel || BR2_mips64 || \
+ (BR2_ARM_CPU_HAS_ARM || BR2_mips || BR2_mipsel || BR2_mips64 || \
BR2_mips64el || BR2_powerpc || BR2_sh || BR2_i386 || BR2_x86_64)
default y if BR2_TOOLCHAIN_USES_UCLIBC && \
- (((BR2_arm || BR2_armeb) && BR2_ARM_CPU_HAS_ARM) || \
- BR2_mips || BR2_mipsel || \
+ (BR2_ARM_CPU_HAS_ARM || BR2_mips || BR2_mipsel || \
BR2_mips64 || BR2_mips64el || BR2_x86_64)
default y if BR2_TOOLCHAIN_USES_MUSL && \
- (((BR2_arm || BR2_armeb) && BR2_ARM_CPU_HAS_ARM) || \
- BR2_i386 || BR2_x86_64)
+ (BR2_ARM_CPU_HAS_ARM || BR2_i386 || BR2_x86_64)
config BR2_PACKAGE_LIBUNWIND
bool "libunwind"
^ permalink raw reply related
* [Buildroot] [PATCH v3 1/2] cracklib: New package
From: Thomas Petazzoni @ 2017-05-04 21:19 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20170419075602.22245-1-stefan.sorensen@spectralink.com>
Hello,
On Wed, 19 Apr 2017 09:56:01 +0200, Stefan S?rensen wrote:
> Changes since v2:
> * Add two upstream bugfixes
> * Add patch to force grep to treat the words file as text
> * Add $(HOST_MAKE_ENV) when build the dict
>
> Changes since v1:
> * Update DEVELOPERS file
> * Use SPDX license codes
> * Use the tools from host-cracklib for generating dictionary files
>
> Signed-off-by: Stefan S?rensen <stefan.sorensen@spectralink.com>
> ---
> DEVELOPERS | 1 +
> package/Config.in | 1 +
> .../0001-Apply-patch-to-fix-CVE-2016-6318.patch | 114 +++++++++++++++++++++
> ...x-a-buffer-overflow-processing-long-words.patch | 49 +++++++++
> ...to-treat-the-input-as-text-when-formattin.patch | 30 ++++++
> package/cracklib/Config.in | 28 +++++
> package/cracklib/cracklib.hash | 3 +
> package/cracklib/cracklib.mk | 36 +++++++
> 8 files changed, 262 insertions(+)
> create mode 100644 package/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch
> create mode 100644 package/cracklib/0002-Fix-a-buffer-overflow-processing-long-words.patch
> create mode 100644 package/cracklib/0003-Force-grep-to-treat-the-input-as-text-when-formattin.patch
> create mode 100644 package/cracklib/Config.in
> create mode 100644 package/cracklib/cracklib.hash
> create mode 100644 package/cracklib/cracklib.mk
You received quite a bit of feedback from Danomi and Romain. Could you
take it into account and send an updated version?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox