DynamoRIO / DynamoRIO/dynamorio

inline asm in signal.c requires binutils 2.16+, ignoring CMAKE_ASM_COMPILER

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
Component-Build Migrated OpSys-Linux Priority-Low
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [derek.br...@gmail.com](https://code.google.com/u/117968039472581148324/) on December 08, 2009 10:37:15_

> [ 3%] Building C object core/CMakeFiles/dynamorio.dir/linux/signal.c.o
> /tmp/ccdiyagw.s: Assembler messages:
> /tmp/ccdiyagw.s:14107: Error: suffix or operands invalid for `fxsave'
\> /tmp/ccdiyagw.s:17970: Error: suffix or operands invalid for`fxsave'
> make[2]: **\* [core/CMakeFiles/dynamorio.dir/linux/signal.c.o] Error 1
> make[1]: **\* [core/CMakeFiles/dynamorio.dir/all] Error 2
> make: **\* [all] Error 2

This is coming from the use of fxsaveq which is only supported by gas
2.16+. The inline asm ends up using your assembler rather than
CMAKE_ASM_COMPILER.

To fix, I would suggest replacing this line:

```
asm volatile( "fxsaveq %0 ; fnclex"
```

With this line:

```
asm volatile( "rex64 ; fxsave %0 ; fnclex"
```

And if your version of gas doesn't even support "rex64" (not sure when that
was added as a separate keyword) then this should always work:

```
asm volatile( ".byte 0x48 ; fxsave %0 ; fnclex"
```

Perhaps worth filing an Issue and fixing for real.

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=240_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.