Linkage issue with gcc (at least Linux) #51
Labels
No Label
aerscript
bug
duplicate
enhancement
help wanted
idea
question
won't fix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: aerscript/Aer#51
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With gcc on linux
^~~~~~~~ sapi/cli/main.c:112:34: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] } else if(c == 'm' || c == 'M' && SyStrlen(argv[n]) > 2) { ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ sapi/cli/main.c:144:7: warning: implicit declaration of function ‘ph7_vm_init’; did you mean ‘ph7_lib_init’? [-Wimplicit-function-declaration] rc = ph7_vm_init(pEngine, &pVm, dump_vm); ^~~~~~~~~~~ ph7_lib_init make[1]: Leaving directory '/home/dcarlier/Contribs/Aer' gcc -o build/aer -Wl,--export-dynamic -Wl,-rpath,/home/dcarlier/Contribs/Aer/binary -Lbuild -laer build/sapi/cli/main.o /usr/bin/ld: build/sapi/cli/main.o: in function
Fatal':main.c:(.text+0x19): undefined reference to
ph7_lib_shutdown' /usr/bin/ld: build/sapi/cli/main.o: in function
main':main.c:(.text+0x1a0): undefined reference to
SyStrlen' /usr/bin/ld: main.c:(.text+0x203): undefined reference to
ph7_init'/usr/bin/ld: main.c:(.text+0x237): undefined reference to
ph7_config' /usr/bin/ld: main.c:(.text+0x26e): undefined reference to
ph7_config'/usr/bin/ld: main.c:(.text+0x289): undefined reference to
ph7_vm_init' /usr/bin/ld: main.c:(.text+0x2da): undefined reference to
ph7_vm_config'/usr/bin/ld: main.c:(.text+0x30f): undefined reference to
ph7_vm_config' /usr/bin/ld: main.c:(.text+0x340): undefined reference to
ph7_vm_config'/usr/bin/ld: main.c:(.text+0x36a): undefined reference to
ph7_compile_file' /usr/bin/ld: main.c:(.text+0x3da): undefined reference to
ph7_vm_config'/usr/bin/ld: main.c:(.text+0x3f9): undefined reference to
ph7_vm_exec' /usr/bin/ld: main.c:(.text+0x417): undefined reference to
ph7_vm_dump'/usr/bin/ld: main.c:(.text+0x423): undefined reference to
ph7_vm_release' /usr/bin/ld: main.c:(.text+0x42f): undefined reference to
ph7_release'collect2: error: ld returned 1 exit status
make: *** [Makefile:154: cli] Error 1
`
while with clang
make build/modules/ctype/ctype.o make[1]: Entering directory '/home/dcarlier/Contribs/Aer' mkdir -p build/modules/ctype/ clang -fPIC -Iinclude -I. -W -Wunused -Wall -DPH7_LIBRARY_SUFFIX=\".so\" -c modules/ctype/ctype.c -o build/modules/ctype/ctype.o make[1]: Leaving directory '/home/dcarlier/Contribs/Aer' clang -o build/ctype.so -Wl,--export-dynamic -shared build/modules/ctype/ctype.o
works as expected.
Most likely Darwin works just fine too.
This looks very strange to me. As you can see it builds just fine:
Both branches can be built with GCC, both on server and on my PC, at least using GCC 9.1.0.
That must be a false alarm. Fails only on one machine (Ubuntu disco). FreeBSD and another Linux (older) box works ok with gcc.