public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Loading plugins with arm-none-eabi-gcc
@ 2020-07-22  6:23 Shuai Wang
  2020-07-22  7:20 ` Andrew Pinski
  0 siblings, 1 reply; 6+ messages in thread
From: Shuai Wang @ 2020-07-22  6:23 UTC (permalink / raw)
  To: GCC Development

Hello,

I am currently trying to migrate a gcc plugin that has been well developed
for x86 code to ARM platform (for arm-none-eabi-gcc).

Currently I did the following steps:

1. write a hello world program t.c

2. compile with the following commands:

    ➜  arm-none-eabi-gcc -v
         ......
         gcc version 9.3.1 20200408 (release) (GNU Arm Embedded Toolchain
9-2020-q2-update)

    ➜  arm-none-eabi-gcc -S -mcpu=cortex-m3 -mthumb -fdump-tree-all t.c

It works fine, and can smoothly print out all gimple code at different
stages.

3. Load my plugin (the plugin is compiled by x64 gcc version 10.0):

➜  file instrument_san_cov.so
instrument_san_cov.so: ELF 64-bit LSB shared object, x86-64, version 1
(SYSV), dynamically linked, with debug_info, not stripped
➜  file arm-none-eabi-gcc
arm-none-eabi-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
2.6.24, BuildID[sha1]=fbadd6adc8607f595caeccae919f3bab9df2d7a6, stripped

➜  arm-none-eabi-gcc -fplugin=./instrument_cov.so -S -mcpu=cortex-m3
-mthumb -fdump-tree-all t.c
cc1: error: cannot load plugin ./instrument_cov.so
   ./instrument_cov.so: undefined symbol:
_Z20build_string_literaliPKcP9tree_nodem

➜  c++filt -n _Z20build_string_literaliPKcP9tree_nodem
build_string_literal(int, char const*, tree_node*, unsigned long)


It seems that somewhat a function named `build_string_literal` cannot be
found. Why is that? I have no idea how to proceed on this matter and cannot
find some proper documents. Any suggestion would be appreciated. Thank you!

Best,
Shuai

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-24  3:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22  6:23 Loading plugins with arm-none-eabi-gcc Shuai Wang
2020-07-22  7:20 ` Andrew Pinski
2020-07-22  7:45   ` Shuai Wang
2020-07-22  8:20     ` Andrew Pinski
2020-07-22 11:22       ` Shuai Wang
2020-07-24  3:05         ` Shuai Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).