Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking issue while building memcached using gLLVM #66

Open
Mohannadcse opened this issue Jul 15, 2022 · 1 comment
Open

Linking issue while building memcached using gLLVM #66

Mohannadcse opened this issue Jul 15, 2022 · 1 comment

Comments

@Mohannadcse
Copy link

Mohannadcse commented Jul 15, 2022

I'm using the scripts Makefile and Makefile_libevent from https://github.com/SRI-CSL/OCCAM-Benchmarks/tree/master/examples/portfolio/memcached to generate the bitcode of Memcached.
But I'm receiving the following error:

gclang  -g -O2 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls  -L/workspaces/neck-identification/gllvmTry/install/libevent/lib  -Wl,-rpath,/workspaces/neck-identification/gllvmTry/install/libevent/lib -o memcached memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o memcached-murmur3_hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats.o memcached-util.o memcached-cache.o    -lpthread -levent 
memcached-hash.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-jenkins_hash.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-slabs.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-items.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-assoc.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-thread.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-daemon.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-stats.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
memcached-util.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: multiple definition of `hash'
memcached-memcached.o:/workspaces/neck-identification/gllvmTry/memcached-1.4.25/./hash.h:5: first defined here
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR:Failed to compile using given arguments:
clang [-g -O2 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -L/workspaces/neck-identification/gllvmTry/install/libevent/lib -Wl,-rpath,/workspaces/neck-identification/gllvmTry/install/libevent/lib -o memcached memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o memcached-murmur3_hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats.o memcached-util.o memcached-cache.o -lpthread -levent]
exit status: exit status 1
Makefile:541: recipe for target 'memcached' failed
make[3]: *** [memcached] Error 1
make[3]: Leaving directory '/workspaces/neck-identification/gllvmTry/memcached-1.4.25'
Makefile:1034: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/workspaces/neck-identification/gllvmTry/memcached-1.4.25'
Makefile:1334: recipe for target 'install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory '/workspaces/neck-identification/gllvmTry/memcached-1.4.25'
Makefile:28: recipe for target '/workspaces/neck-identification/gllvmTry/install/memcached/bin/memcached' failed
make: *** [/workspaces/neck-identification/gllvmTry/install/memcached/bin/memcached] Error 2
@ianamason
Copy link
Member

So all I can suggest it that you try to get the link to work with clang

clang  -g -O2 -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls  -L/workspaces/neck-identification/gllvmTry/install/libevent/lib  -Wl,-rpath,/workspaces/neck-identification/gllvmTry/install/libevent/lib -o memcached memcached-memcached.o memcached-hash.o memcached-jenkins_hash.o memcached-murmur3_hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats.o memcached-util.o memcached-cache.o    -lpthread -levent 

on the command line, you will probably have to play around with the flags. Then try it again with those same flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants