-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add support for more ARM processors detection #608
fix: Add support for more ARM processors detection #608
Conversation
@@ -11,7 +11,7 @@ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" | |||
else() | |||
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_X64_FLAGS}") | |||
endif() | |||
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm") | |||
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm.*|aarch64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason to use regex matches rather than just STREQUAL arm OR STREQUAL(aarch64)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, yes there is.
On unix systems CMAKE_SYSTEM_PROCESSOR
is set to the output of uname -p
which, after some googling through some common ARM based boards (rpi3, odroid) I see the arm instruction set version appended at the end, e.g. armv7l
, armv6l
. I'm also guessing the original author had a system where CMAKE_SYSTEM_PROCESSOR
was set to arm
so the regex arm.*
should match all these possibilities whereas STREQAL arm
wouldn't due to it not being an exact match.
Also, since we don't have test coverage for ARM yet, could you please test and verify that your change works? |
Here is the build/execution log on an nvidia Xavier Looks like absl_sysinfo_test failed. Running the test manually I get
Which seems it might be a normal problem according to the comment?? abseil-cpp/absl/base/internal/sysinfo_test.cc Lines 45 to 48 in a2e6ade
|
-- 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 by Eric Fiselier <ericwf@google.com>: Workaround bug in GCC 9.2 and after. PiperOrigin-RevId: 291982551 -- 47ff4820e595f96c082a90d733725f6882d83e3b by Abseil Team <absl-team@google.com>: Improve ABSL_ATTRIBUTE_PACKED documentation Recommend to apply ABSL_ATTRIBUTE_PACKED to structure members instead of to an entire structure because applying this attribute to an entire structure may cause the compiler to generate suboptimal code. It reduces the alignment of the data structure from a value larger than one to one. When applied to a structure, ABSL_ATTRIBUTE_PACKED reduces the alignment of a structure (alignof()) to 1. As a result, the compiler can no longer assume that e.g. uint32 members are aligned on a four byte boundary and hence is forced to use single-byte load and store instructions on CPU architectures that do not support non-aligned loads or stores. PiperOrigin-RevId: 291977920 -- 902b7a86f860da699d3a2e5c738be5ef73ede3b4 by Mark Barolak <mbar@google.com>: Internal change PiperOrigin-RevId: 291963048 -- bb3bd3247e376d53a3080b105f13ec7566d3ae50 by Abseil Team <absl-team@google.com>: Support the C++17 insert_or_assign() API in btree_map. PiperOrigin-RevId: 291945474 -- ff3b3cfcbbc64f086f95501f48d49426bcde356f by Gennadiy Rozental <rogeeff@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 291861110 -- fd465cd9cbbacd3962f67a7346d6462edaddd809 by Derek Mauro <dmauro@google.com>: Add flaky=1 to beta_distribution_test. PiperOrigin-RevId: 291757364 -- 3603adfb59c4128c542b670952cce250d59e1f67 by Derek Mauro <dmauro@google.com>: Separate the initialization of NumCPUs() and NominalCPUFrequency() The OSS version of Abseil never needs to call NominalCPUFrequency(). In some configurations, initializing NominalCPUFrequency() requires spending at least 3ms measuring the CPU frequency. By separating the initialization from NumCPUs(), which is called in most configurations, we can save at least 3ms of program startup time. PiperOrigin-RevId: 291737273 -- bea9e4a6bff5a0351d340deab966641867e08c4d by Abseil Team <absl-team@google.com>: Change the cmake library names not to have a redundant `absl_` prefix. PiperOrigin-RevId: 291640501 -- 501b602ef260cd7c8c527342581ceffb3c5b6d4c by Gennadiy Rozental <rogeeff@google.com>: Introducing benchmark for absl::GetFlag. PiperOrigin-RevId: 291433394 -- 4eeaddc788da4b91c272a8adca77ca6dbbbc1d44 by Xiaoyi Zhang <zhangxy@google.com>: fix: Add support for more ARM processors detection Import of #608 PiperOrigin-RevId: 291420397 -- a3087a8e883c5d71de7d9bd4ec8f4db5142dfcf5 by Derek Mauro <dmauro@google.com>: Removes the flaky raw_hash_set prefetch test PiperOrigin-RevId: 291197079 -- aad6c2121c102ac36216e771c83227cf3e3bfd66 by Andy Soffer <asoffer@google.com>: Enable building Abseil as a DLL. This is currently experimental and unsupported. This CL does a few things: 1. Adds the ABSL_DLL macro to any class holding a static data member, or to global constants in headers. 2. Adds a whitelist of all files in the DLL and all the build targets that are conglomerated into the DLL. 3. When BUILD_SHARED_LIBS is specified, any build target that would be in the DLL still exists, but we swap out all of it's dependencies so it just depends on abseil_dll PiperOrigin-RevId: 291192055 -- 5e888cd6f2a7722805d41f872108a03a84e421c7 by Mark Barolak <mbar@google.com>: Move absl/strings/internal/escaping.{cc,h} into internal build targets. This puts absl/strings/internal/escaping.h behind a whitelist and it also resolves #604. PiperOrigin-RevId: 291173320 -- 166836d24970da87587c1728036f53f05a28f0af by Eric Fiselier <ericwf@google.com>: Internal Change. PiperOrigin-RevId: 291012718 -- 996ddb3dffda02440fa93f30ca5d71b14b688875 by Abseil Team <absl-team@google.com>: Fix shared libraries log spam for built-in types in absl::GetFlag PiperOrigin-RevId: 290772743 GitOrigin-RevId: 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 Change-Id: I8bf2265dd14ebbace220a1b6b982bb5040ad2a26
- 0033c9e Fix build on FreeBSD/powerpc (#616) by kgotlinux <60880393+kgotlinux@users.noreply.github.com> - 0d5ce27 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - b69c7d8 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 2a5633f Merge "Export of internal Abseil changes" by Xiaoyi Zhang <zhangxy@google.com> - f9b3d6e Add RISCV support to GetProgramCounter() (#621) by Khem Raj <raj.khem@gmail.com> - 0232c87 Add missing ABSL_HAVE_VDSO_SUPPORT conditional (#622) by Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> - 3c81410 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - c44657f Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 98eb410 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - bf78e97 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - d95d156 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 24713a7 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 72382c2 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 08a7e7b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 36bcd95 Fix pointer format specifier in documentation (#614) by Andre Nguyen <andre-nguyen@users.noreply.github.com> - 0f86336 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - c512f11 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 37dd256 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 4442770 fix: Add support for more ARM processors detection (#608) by Andre Nguyen <andre-nguyen@users.noreply.github.com> - 159bf2b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - a2e6ade Use https links. (#586) by nlewycky <nicholas@mxc.ca> - 564001a Export of internal Abseil changes by Abseil Team <absl-team@google.com> - b3aaac8 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 63ee2f8 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - a048203 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 1de0166 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ad904b6 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 2923513 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - bf86cfe Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 12bc53e Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 1e39f86 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 77f8700 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - d659fe5 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - a4b757b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 0514227 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 7f4fe64 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 16d9fd5 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - bcaae60 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 8ba96a8 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 2103fd9 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 3df7b52 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - fa8c751 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 85092b4 Fix Conan builds (#400) by Adrian Ostrowski <adr.ostrowski@gmail.com> - e96ae22 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 20de2db Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 846e5db Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 8207907 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 078b89b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 19b021c Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ecc0033 Always enable proper symbolize implementation on Windows ... by Loo Rong Jie <loorongjie@gmail.com> - 2796d50 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - e4c8d0e Export of internal Abseil changes by Abseil Team <absl-team@google.com> - a15364c Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ab3552a Export of internal Abseil changes by Abseil Team <absl-team@google.com> - e9f9000 Fix ABSL_WAITER_MODE detection for mingw (#342) by Joe Sylve <Joe.Sylve@gmail.com> - abea769 Fix ABSL_HAVE_ALARM check on mingw (#341) by Joe Sylve <Joe.Sylve@gmail.com> - 25597bd Export of internal Abseil changes by Abseil Team <absl-team@google.com> - aad33fe Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 8fe7214 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - debac94 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 882b350 Fix spelling errors (#384) by Sungmann Cho <55860394+chosungmann@users.noreply.github.com> - 502efe6 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ccdd1d5 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ddf8e52 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 6ec1362 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - ac78ffc Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 5374c56 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 97c1664 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 325fd7b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 83c1d65 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - eb6b7bd Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 9ddac55 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 1948f6f Export of internal Abseil changes by Abseil Team <absl-team@google.com> - a0d1e09 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 2d2d7fb Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 0302d1e supppress unused variable warning for gcc (#372) by Martin <pizzard@users.noreply.github.com> - 262d74b Export of internal Abseil changes by Abseil Team <absl-team@google.com> - f0afae0 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 0e7afdc Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 9a41ffd Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 36910d3 [bazel] Add fixes for --incompatible_load_cc_rules_from_b... by Yannic <contact@yannic-bonenberger.com> - aae8143 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - d9aa92d Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 321ab53 Export of internal Abseil changes by Abseil Team <absl-team@google.com> - 4ef5740 Export of internal Abseil changes by Abseil Team <absl-team@google.com> GitOrigin-RevId: 0033c9e Change-Id: I8a2b70063cb3ab40c6943a6db0fe40cae71ed8d7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
بروزرسانی میخواهم بکنم چکارکنم
Internal change submitted. Merging this PR. The unit test can be fixed in another PR.
-- 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 by Eric Fiselier <ericwf@google.com>: Workaround bug in GCC 9.2 and after. PiperOrigin-RevId: 291982551 -- 47ff4820e595f96c082a90d733725f6882d83e3b by Abseil Team <absl-team@google.com>: Improve ABSL_ATTRIBUTE_PACKED documentation Recommend to apply ABSL_ATTRIBUTE_PACKED to structure members instead of to an entire structure because applying this attribute to an entire structure may cause the compiler to generate suboptimal code. It reduces the alignment of the data structure from a value larger than one to one. When applied to a structure, ABSL_ATTRIBUTE_PACKED reduces the alignment of a structure (alignof()) to 1. As a result, the compiler can no longer assume that e.g. uint32 members are aligned on a four byte boundary and hence is forced to use single-byte load and store instructions on CPU architectures that do not support non-aligned loads or stores. PiperOrigin-RevId: 291977920 -- 902b7a86f860da699d3a2e5c738be5ef73ede3b4 by Mark Barolak <mbar@google.com>: Internal change PiperOrigin-RevId: 291963048 -- bb3bd3247e376d53a3080b105f13ec7566d3ae50 by Abseil Team <absl-team@google.com>: Support the C++17 insert_or_assign() API in btree_map. PiperOrigin-RevId: 291945474 -- ff3b3cfcbbc64f086f95501f48d49426bcde356f by Gennadiy Rozental <rogeeff@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 291861110 -- fd465cd9cbbacd3962f67a7346d6462edaddd809 by Derek Mauro <dmauro@google.com>: Add flaky=1 to beta_distribution_test. PiperOrigin-RevId: 291757364 -- 3603adfb59c4128c542b670952cce250d59e1f67 by Derek Mauro <dmauro@google.com>: Separate the initialization of NumCPUs() and NominalCPUFrequency() The OSS version of Abseil never needs to call NominalCPUFrequency(). In some configurations, initializing NominalCPUFrequency() requires spending at least 3ms measuring the CPU frequency. By separating the initialization from NumCPUs(), which is called in most configurations, we can save at least 3ms of program startup time. PiperOrigin-RevId: 291737273 -- bea9e4a6bff5a0351d340deab966641867e08c4d by Abseil Team <absl-team@google.com>: Change the cmake library names not to have a redundant `absl_` prefix. PiperOrigin-RevId: 291640501 -- 501b602ef260cd7c8c527342581ceffb3c5b6d4c by Gennadiy Rozental <rogeeff@google.com>: Introducing benchmark for absl::GetFlag. PiperOrigin-RevId: 291433394 -- 4eeaddc788da4b91c272a8adca77ca6dbbbc1d44 by Xiaoyi Zhang <zhangxy@google.com>: fix: Add support for more ARM processors detection Import of abseil#608 PiperOrigin-RevId: 291420397 -- a3087a8e883c5d71de7d9bd4ec8f4db5142dfcf5 by Derek Mauro <dmauro@google.com>: Removes the flaky raw_hash_set prefetch test PiperOrigin-RevId: 291197079 -- aad6c2121c102ac36216e771c83227cf3e3bfd66 by Andy Soffer <asoffer@google.com>: Enable building Abseil as a DLL. This is currently experimental and unsupported. This CL does a few things: 1. Adds the ABSL_DLL macro to any class holding a static data member, or to global constants in headers. 2. Adds a whitelist of all files in the DLL and all the build targets that are conglomerated into the DLL. 3. When BUILD_SHARED_LIBS is specified, any build target that would be in the DLL still exists, but we swap out all of it's dependencies so it just depends on abseil_dll PiperOrigin-RevId: 291192055 -- 5e888cd6f2a7722805d41f872108a03a84e421c7 by Mark Barolak <mbar@google.com>: Move absl/strings/internal/escaping.{cc,h} into internal build targets. This puts absl/strings/internal/escaping.h behind a whitelist and it also resolves abseil#604. PiperOrigin-RevId: 291173320 -- 166836d24970da87587c1728036f53f05a28f0af by Eric Fiselier <ericwf@google.com>: Internal Change. PiperOrigin-RevId: 291012718 -- 996ddb3dffda02440fa93f30ca5d71b14b688875 by Abseil Team <absl-team@google.com>: Fix shared libraries log spam for built-in types in absl::GetFlag PiperOrigin-RevId: 290772743 GitOrigin-RevId: 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 Change-Id: I8bf2265dd14ebbace220a1b6b982bb5040ad2a26
-- 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 by Eric Fiselier <ericwf@google.com>: Workaround bug in GCC 9.2 and after. PiperOrigin-RevId: 291982551 -- 47ff4820e595f96c082a90d733725f6882d83e3b by Abseil Team <absl-team@google.com>: Improve ABSL_ATTRIBUTE_PACKED documentation Recommend to apply ABSL_ATTRIBUTE_PACKED to structure members instead of to an entire structure because applying this attribute to an entire structure may cause the compiler to generate suboptimal code. It reduces the alignment of the data structure from a value larger than one to one. When applied to a structure, ABSL_ATTRIBUTE_PACKED reduces the alignment of a structure (alignof()) to 1. As a result, the compiler can no longer assume that e.g. uint32 members are aligned on a four byte boundary and hence is forced to use single-byte load and store instructions on CPU architectures that do not support non-aligned loads or stores. PiperOrigin-RevId: 291977920 -- 902b7a86f860da699d3a2e5c738be5ef73ede3b4 by Mark Barolak <mbar@google.com>: Internal change PiperOrigin-RevId: 291963048 -- bb3bd3247e376d53a3080b105f13ec7566d3ae50 by Abseil Team <absl-team@google.com>: Support the C++17 insert_or_assign() API in btree_map. PiperOrigin-RevId: 291945474 -- ff3b3cfcbbc64f086f95501f48d49426bcde356f by Gennadiy Rozental <rogeeff@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 291861110 -- fd465cd9cbbacd3962f67a7346d6462edaddd809 by Derek Mauro <dmauro@google.com>: Add flaky=1 to beta_distribution_test. PiperOrigin-RevId: 291757364 -- 3603adfb59c4128c542b670952cce250d59e1f67 by Derek Mauro <dmauro@google.com>: Separate the initialization of NumCPUs() and NominalCPUFrequency() The OSS version of Abseil never needs to call NominalCPUFrequency(). In some configurations, initializing NominalCPUFrequency() requires spending at least 3ms measuring the CPU frequency. By separating the initialization from NumCPUs(), which is called in most configurations, we can save at least 3ms of program startup time. PiperOrigin-RevId: 291737273 -- bea9e4a6bff5a0351d340deab966641867e08c4d by Abseil Team <absl-team@google.com>: Change the cmake library names not to have a redundant `absl_` prefix. PiperOrigin-RevId: 291640501 -- 501b602ef260cd7c8c527342581ceffb3c5b6d4c by Gennadiy Rozental <rogeeff@google.com>: Introducing benchmark for absl::GetFlag. PiperOrigin-RevId: 291433394 -- 4eeaddc788da4b91c272a8adca77ca6dbbbc1d44 by Xiaoyi Zhang <zhangxy@google.com>: fix: Add support for more ARM processors detection Import of abseil/abseil-cpp#608 PiperOrigin-RevId: 291420397 -- a3087a8e883c5d71de7d9bd4ec8f4db5142dfcf5 by Derek Mauro <dmauro@google.com>: Removes the flaky raw_hash_set prefetch test PiperOrigin-RevId: 291197079 -- aad6c2121c102ac36216e771c83227cf3e3bfd66 by Andy Soffer <asoffer@google.com>: Enable building Abseil as a DLL. This is currently experimental and unsupported. This CL does a few things: 1. Adds the ABSL_DLL macro to any class holding a static data member, or to global constants in headers. 2. Adds a whitelist of all files in the DLL and all the build targets that are conglomerated into the DLL. 3. When BUILD_SHARED_LIBS is specified, any build target that would be in the DLL still exists, but we swap out all of it's dependencies so it just depends on abseil_dll PiperOrigin-RevId: 291192055 -- 5e888cd6f2a7722805d41f872108a03a84e421c7 by Mark Barolak <mbar@google.com>: Move absl/strings/internal/escaping.{cc,h} into internal build targets. This puts absl/strings/internal/escaping.h behind a whitelist and it also resolves abseil/abseil-cpp#604. PiperOrigin-RevId: 291173320 -- 166836d24970da87587c1728036f53f05a28f0af by Eric Fiselier <ericwf@google.com>: Internal Change. PiperOrigin-RevId: 291012718 -- 996ddb3dffda02440fa93f30ca5d71b14b688875 by Abseil Team <absl-team@google.com>: Fix shared libraries log spam for built-in types in absl::GetFlag PiperOrigin-RevId: 290772743 GitOrigin-RevId: 8bdb2020150ed0fd4a4e520e454dc5f54e33f776 Change-Id: I8bf2265dd14ebbace220a1b6b982bb5040ad2a26
aarch64
is the processor string returned by an Nvidia TX2 and an Nvidia Xavier.arm.*
should be able to match processors such asarmv7l
(Raspberry pi 3, Odroid)Fixes #603