Skip to content
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

glib-2.66: add 001-fix_asm_older_compiler.patch #6231

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions cross/glib-2.66/patches/001-fix_asm_older_compiler.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--- ./glib/gbitlock.c-orig 2021-03-18 13:47:48.316693300 +0000
+++ ./glib/gbitlock.c 2024-09-15 22:38:25.865961409 +0000
@@ -322,10 +322,10 @@ g_bit_unlock (volatile gint *address,
gint lock_bit)
{
#ifdef USE_ASM_GOTO
- asm volatile ("lock btr %1, (%0)"
- : /* no output */
- : "r" (address), "r" (lock_bit)
- : "cc", "memory");
+ __asm__ volatile ("lock btr %1, (%0)"
+ : /* no output */
+ : "r" (address), "r" (lock_bit)
+ : "cc", "memory");
#else
guint mask = 1u << lock_bit;

@@ -405,12 +405,12 @@ void
{
#ifdef USE_ASM_GOTO
retry:
- asm volatile goto ("lock bts %1, (%0)\n"
- "jc %l[contended]"
- : /* no output */
- : "r" (address), "r" ((gsize) lock_bit)
- : "cc", "memory"
- : contended);
+ __asm__ volatile goto ("lock bts %1, (%0)\n"
+ "jc %l[contended]"
+ : /* no output */
+ : "r" (address), "r" ((gsize) lock_bit)
+ : "cc", "memory"
+ : contended);
return;

contended:
@@ -477,12 +477,12 @@ gboolean
#ifdef USE_ASM_GOTO
gboolean result;

- asm volatile ("lock bts %2, (%1)\n"
- "setnc %%al\n"
- "movzx %%al, %0"
- : "=r" (result)
- : "r" (address), "r" ((gsize) lock_bit)
- : "cc", "memory");
+ __asm__ volatile ("lock bts %2, (%1)\n"
+ "setnc %%al\n"
+ "movzx %%al, %0"
+ : "=r" (result)
+ : "r" (address), "r" ((gsize) lock_bit)
+ : "cc", "memory");

return result;
#else
@@ -520,10 +520,10 @@ void

{
#ifdef USE_ASM_GOTO
- asm volatile ("lock btr %1, (%0)"
- : /* no output */
- : "r" (address), "r" ((gsize) lock_bit)
- : "cc", "memory");
+ __asm__ volatile ("lock btr %1, (%0)"
+ : /* no output */
+ : "r" (address), "r" ((gsize) lock_bit)
+ : "cc", "memory");
#else
volatile gsize *pointer_address = address;
gsize mask = 1u << lock_bit;
Loading