Skip to content

ARM: Linking fails when compiled with optimization turned on #2

@florommel

Description

@florommel

Compiling with multiverse plugin enabled and optimization (-O1, -O2, -O3, -Os, -Og) causes an undefined reference to '.LANCHOR1' during linking.
[GCC version: 6.3.1, arch: armv6l]

I removed the -O2 option in tests/Makefile as a temporary workaround.

Reproduce: in directory tests (note that option -O2 is specified):

$ gcc -o commit-refs.o -c commit-refs.c -fplugin=../gcc-plugin/multiverse.so -I../libmultiverse -O2 -Wextra -MT commit-refs.o -MMD -MP -MF .d/commit-refs.Td
...
$ gcc -L../libmultiverse -o commit-refs commit-refs.o  -lmultiverse
commit-refs.o: In function `_GLOBAL__sub_I_65535_0_func_a':
commit-refs.c:(.text.startup+0x1d8): undefined reference to `.LANCHOR1'
collect2: error: ld returned 1 exit status

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions