-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Translate arch into source directory when ARCH is set #2122
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When ARCH is not defined, bcc get the architecture from uname. It then modifies it to get the name of arch directory in linux source. When ARCH is defined however, it just copy it as is, without the translation to the arch directory. If for instance ARCH is set to x86_64, it tries to look into the include directory build/arch/x86_64/, which doesn't exist. It fixes the following issue: $ echo $ARCH x86_64 $ /usr/share/bcc/tools/bashreadline In file included from <built-in>:2: In file included from /virtual/include/bcc/bpf.h:12: In file included from /lib/modules/4.18.0-49.el8.x86_64/build/include/linux/types.h:6: /lib/modules/4.18.0-49.el8.x86_64/build/include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found ^~~~~~~~~~~~~ 1 error generated. Traceback (most recent call last): File "/usr/share/bcc/tools/bashreadline", line 51, in <module> b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 318, in __init__ raise Exception("Failed to compile BPF text") Exception: Failed to compile BPF text
[buildbot, test this please] |
2 similar comments
[buildbot, test this please] |
[buildbot, test this please] |
brendangregg
pushed a commit
to brendangregg/bcc
that referenced
this pull request
Jan 11, 2019
When ARCH is not defined, bcc get the architecture from uname. It then modifies it to get the name of arch directory in linux source. When ARCH is defined however, it just copy it as is, without the translation to the arch directory. If for instance ARCH is set to x86_64, it tries to look into the include directory build/arch/x86_64/, which doesn't exist. It fixes the following issue: $ echo $ARCH x86_64 $ /usr/share/bcc/tools/bashreadline In file included from <built-in>:2: In file included from /virtual/include/bcc/bpf.h:12: In file included from /lib/modules/4.18.0-49.el8.x86_64/build/include/linux/types.h:6: /lib/modules/4.18.0-49.el8.x86_64/build/include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found ^~~~~~~~~~~~~ 1 error generated. Traceback (most recent call last): File "/usr/share/bcc/tools/bashreadline", line 51, in <module> b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 318, in __init__ raise Exception("Failed to compile BPF text") Exception: Failed to compile BPF text
10ne1
added a commit
to 10ne1/bcc
that referenced
this pull request
Mar 26, 2019
Commit 28949f1 ("Translate arch into source directory when ARCH is set") moved $ARCH processing earlier in the function so $ARCH gets processed by the the same logic which parses the uname_machine value. This introduced two bugs breaking ARCH=arm64 cross-compilation: 1. The arch.compare(0, 3, "arm") test matches both $ARCH=arm and $ARCH=arm64 leading to builds which always include from "arch/arm/include" instead of "arch/arm64/include". 2. The only way arch == arm64 is if $ARCH=aarch64. uname returns aarch64 but the rest of the compiler logic expects $ARCH=arm64. This fixes the above bugs by moving the "aarch64" test earlier than the "arm" test and also accepting ARCH=arm64. Fixes: 28949f1 ("Translate arch into source directory when ARCH is set (iovisor#2122)") Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
yonghong-song
pushed a commit
that referenced
this pull request
Mar 26, 2019
Commit 28949f1 ("Translate arch into source directory when ARCH is set") moved $ARCH processing earlier in the function so $ARCH gets processed by the the same logic which parses the uname_machine value. This introduced two bugs breaking ARCH=arm64 cross-compilation: 1. The arch.compare(0, 3, "arm") test matches both $ARCH=arm and $ARCH=arm64 leading to builds which always include from "arch/arm/include" instead of "arch/arm64/include". 2. The only way arch == arm64 is if $ARCH=aarch64. uname returns aarch64 but the rest of the compiler logic expects $ARCH=arm64. This fixes the above bugs by moving the "aarch64" test earlier than the "arm" test and also accepting ARCH=arm64. Fixes: 28949f1 ("Translate arch into source directory when ARCH is set (#2122)") Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
palexster
pushed a commit
to palexster/bcc
that referenced
this pull request
Jul 7, 2019
When ARCH is not defined, bcc get the architecture from uname. It then modifies it to get the name of arch directory in linux source. When ARCH is defined however, it just copy it as is, without the translation to the arch directory. If for instance ARCH is set to x86_64, it tries to look into the include directory build/arch/x86_64/, which doesn't exist. It fixes the following issue: $ echo $ARCH x86_64 $ /usr/share/bcc/tools/bashreadline In file included from <built-in>:2: In file included from /virtual/include/bcc/bpf.h:12: In file included from /lib/modules/4.18.0-49.el8.x86_64/build/include/linux/types.h:6: /lib/modules/4.18.0-49.el8.x86_64/build/include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found ^~~~~~~~~~~~~ 1 error generated. Traceback (most recent call last): File "/usr/share/bcc/tools/bashreadline", line 51, in <module> b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 318, in __init__ raise Exception("Failed to compile BPF text") Exception: Failed to compile BPF text
palexster
pushed a commit
to palexster/bcc
that referenced
this pull request
Jul 7, 2019
Commit 28949f1 ("Translate arch into source directory when ARCH is set") moved $ARCH processing earlier in the function so $ARCH gets processed by the the same logic which parses the uname_machine value. This introduced two bugs breaking ARCH=arm64 cross-compilation: 1. The arch.compare(0, 3, "arm") test matches both $ARCH=arm and $ARCH=arm64 leading to builds which always include from "arch/arm/include" instead of "arch/arm64/include". 2. The only way arch == arm64 is if $ARCH=aarch64. uname returns aarch64 but the rest of the compiler logic expects $ARCH=arm64. This fixes the above bugs by moving the "aarch64" test earlier than the "arm" test and also accepting ARCH=arm64. Fixes: 28949f1 ("Translate arch into source directory when ARCH is set (iovisor#2122)") Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
CrackerCat
pushed a commit
to CrackerCat/bcc
that referenced
this pull request
Jul 31, 2024
When ARCH is not defined, bcc get the architecture from uname. It then modifies it to get the name of arch directory in linux source. When ARCH is defined however, it just copy it as is, without the translation to the arch directory. If for instance ARCH is set to x86_64, it tries to look into the include directory build/arch/x86_64/, which doesn't exist. It fixes the following issue: $ echo $ARCH x86_64 $ /usr/share/bcc/tools/bashreadline In file included from <built-in>:2: In file included from /virtual/include/bcc/bpf.h:12: In file included from /lib/modules/4.18.0-49.el8.x86_64/build/include/linux/types.h:6: /lib/modules/4.18.0-49.el8.x86_64/build/include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file not found ^~~~~~~~~~~~~ 1 error generated. Traceback (most recent call last): File "/usr/share/bcc/tools/bashreadline", line 51, in <module> b = BPF(text=bpf_text) File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 318, in __init__ raise Exception("Failed to compile BPF text") Exception: Failed to compile BPF text
CrackerCat
pushed a commit
to CrackerCat/bcc
that referenced
this pull request
Jul 31, 2024
Commit 28949f1 ("Translate arch into source directory when ARCH is set") moved $ARCH processing earlier in the function so $ARCH gets processed by the the same logic which parses the uname_machine value. This introduced two bugs breaking ARCH=arm64 cross-compilation: 1. The arch.compare(0, 3, "arm") test matches both $ARCH=arm and $ARCH=arm64 leading to builds which always include from "arch/arm/include" instead of "arch/arm64/include". 2. The only way arch == arm64 is if $ARCH=aarch64. uname returns aarch64 but the rest of the compiler logic expects $ARCH=arm64. This fixes the above bugs by moving the "aarch64" test earlier than the "arm" test and also accepting ARCH=arm64. Fixes: 28949f1 ("Translate arch into source directory when ARCH is set (iovisor#2122)") Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When ARCH is not defined, bcc get the architecture from uname. It then
modifies it to get the name of arch directory in linux source.
When ARCH is defined however, it just copy it as is, without the
translation to the arch directory. If for instance ARCH is set to
x86_64, it tries to look into the include directory
build/arch/x86_64/, which doesn't exist.
It fixes the following issue:
$ echo $ARCH
x86_64
$ /usr/share/bcc/tools/bashreadline
In file included from :2:
In file included from /virtual/include/bcc/bpf.h:12:
In file included from /lib/modules/4.18.0-49.el8.x86_64/build/include/linux/types.h:6:
/lib/modules/4.18.0-49.el8.x86_64/build/include/uapi/linux/types.h:5:10: fatal error: 'asm/types.h' file
not found
^~~~~~~~~~~~~
1 error generated.
Traceback (most recent call last):
File "/usr/share/bcc/tools/bashreadline", line 51, in
b = BPF(text=bpf_text)
File "/usr/lib/python3.6/site-packages/bcc/init.py", line 318, in init
raise Exception("Failed to compile BPF text")
Exception: Failed to compile BPF text