Skip to content

Commit

Permalink
Unbreak powerpc-unknown-linux-uclibc.
Browse files Browse the repository at this point in the history
There is invalid assembly in dmalloc for PowerPC. The issue is that
'stw' expects a memory operand, and =g constraint allows both registers
and memory. Newer GCC tends to choose register even at -O0, resulting in
invalid assembly. Instead, force a register constraint in 'mflr' and let
GCC decide if it wants to store it into memory at all.

Reported this upstream.

Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Apr 2, 2016
1 parent e1d494a commit 85af584
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/dmalloc/5.5.2/170-ppc-bogus-assembly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -ur dmalloc-5.5.2.orig/return.h dmalloc-5.5.2/return.h
--- dmalloc-5.5.2.orig/return.h 2016-03-13 13:11:48.090431764 -0700
+++ dmalloc-5.5.2/return.h 2016-03-13 13:12:11.246642618 -0700
@@ -251,8 +251,7 @@

#define GET_RET_ADDR(file) \
do { \
- asm("mflr 0"); \
- asm("stw 0,%0" : "=g" (file)); \
+ asm("mflr %0" : "=r"(file)); \
} while(0)

#endif /* __powerpc__ && __GNUC__ && !__OPTIMIZE__ */
Empty file.

0 comments on commit 85af584

Please sign in to comment.