glibcextract.py: Place un-assemblable @@@ in a comment
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
Unlike GCC, Clang passes asm statements and verifies they are valid
instructions/directives. Place the magic @@@ into a comment to avoid
a parse error.
---
scripts/glibcextract.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 2021-10-07, Fangrui Song wrote:
>Unlike GCC, Clang passes asm statements and verifies they are valid
>instructions/directives. Place the magic @@@ into a comment to avoid
>a parse error.
>---
> scripts/glibcextract.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
>index 752ff6223b..bf49a5e322 100644
>--- a/scripts/glibcextract.py
>+++ b/scripts/glibcextract.py
>@@ -45,7 +45,7 @@ def compute_c_consts(sym_data, cc):
> continue
> name = arg[0]
> value = arg[1]
>- out_lines.append('asm ("@@@name@@@%s@@@value@@@%%0@@@end@@@" '
>+ out_lines.append('asm ("/* @@@name@@@%s@@@value@@@%%0@@@end@@@ */" '
> ': : \"i\" ((long int) (%s)));'
> % (name, value))
> out_lines.append('}')
>--
>2.33.0.882.g93a45727a2-goog
>
Ping..
On Fri, Oct 15, 2021 at 9:29 AM Fangrui Song <maskray@google.com> wrote:
>
> On 2021-10-07, Fangrui Song wrote:
> >Unlike GCC, Clang passes asm statements and verifies they are valid
> >instructions/directives. Place the magic @@@ into a comment to avoid
> >a parse error.
> >---
> > scripts/glibcextract.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
> >index 752ff6223b..bf49a5e322 100644
> >--- a/scripts/glibcextract.py
> >+++ b/scripts/glibcextract.py
> >@@ -45,7 +45,7 @@ def compute_c_consts(sym_data, cc):
> > continue
> > name = arg[0]
> > value = arg[1]
> >- out_lines.append('asm ("@@@name@@@%s@@@value@@@%%0@@@end@@@" '
> >+ out_lines.append('asm ("/* @@@name@@@%s@@@value@@@%%0@@@end@@@ */" '
> > ': : \"i\" ((long int) (%s)));'
> > % (name, value))
> > out_lines.append('}')
> >--
> >2.33.0.882.g93a45727a2-goog
> >
>
> Ping..
This seems trivial and straightforward. I'll give a few days and then push it.
* Fangrui Song via Libc-alpha:
> Unlike GCC, Clang passes asm statements and verifies they are valid
> instructions/directives. Place the magic @@@ into a comment to avoid
> a parse error.
> ---
> scripts/glibcextract.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/glibcextract.py b/scripts/glibcextract.py
> index 752ff6223b..bf49a5e322 100644
> --- a/scripts/glibcextract.py
> +++ b/scripts/glibcextract.py
> @@ -45,7 +45,7 @@ def compute_c_consts(sym_data, cc):
> continue
> name = arg[0]
> value = arg[1]
> - out_lines.append('asm ("@@@name@@@%s@@@value@@@%%0@@@end@@@" '
> + out_lines.append('asm ("/* @@@name@@@%s@@@value@@@%%0@@@end@@@ */" '
> ': : \"i\" ((long int) (%s)));'
> % (name, value))
> out_lines.append('}')
Seems reasonable, thanks.
Florian
On Okt 07 2021, Fangrui Song via Libc-alpha wrote:
> Unlike GCC, Clang passes asm statements and verifies they are valid
parses
Andreas.
@@ -45,7 +45,7 @@ def compute_c_consts(sym_data, cc):
continue
name = arg[0]
value = arg[1]
- out_lines.append('asm ("@@@name@@@%s@@@value@@@%%0@@@end@@@" '
+ out_lines.append('asm ("/* @@@name@@@%s@@@value@@@%%0@@@end@@@ */" '
': : \"i\" ((long int) (%s)));'
% (name, value))
out_lines.append('}')