Skip to content

Fix the build when using gcc v10 or later#58

Closed
natoscott wants to merge 4 commits intoRedisLabs:masterfrom
natoscott:master
Closed

Fix the build when using gcc v10 or later#58
natoscott wants to merge 4 commits intoRedisLabs:masterfrom
natoscott:master

Conversation

@natoscott
Copy link
Contributor

Annotate module API functions in redismodule.h for use with -fno-common.

Relates to redis/redis#6900

gcc -shared -Wl,-Bsymbolic-functions -o redisraft.so redisraft.o common.o node.o util.o config.o raft.o snapshot.o log.o proxy.o serialization.o /source/redisraft/.build/lib/libraft.a /source/redisraft/.build/lib/libhiredis.a /source/redisraft/.build/lib/libuv.a -lpthread
/usr/bin/ld: common.o:/source/redisraft/redismodule.h:442: multiple definition of RedisModule_Alloc'; redisraft.o:/source/redisraft/redismodule.h:442: first defined here /usr/bin/ld: common.o:/source/redisraft/redismodule.h:443: multiple definition of RedisModule_Realloc'; redisraft.o:/source/redisraft/redismodule.h:443: first defined here
/usr/bin/ld: common.o:/source/redisraft/redismodule.h:444: multiple definition of RedisModule_Free'; redisraft.o:/source/redisraft/redismodule.h:444: first defined here /usr/bin/ld: common.o:/source/redisraft/redismodule.h:445: multiple definition of RedisModule_Calloc'; redisraft.o:/source/redisraft/redismodule.h:445: first defined here
/usr/bin/ld: common.o:/source/redisraft/redismodule.h:446: multiple definition of RedisModule_Strdup'; redisraft.o:/source/redisraft/redismodule.h:446: first defined here /usr/bin/ld: common.o:/source/redisraft/redismodule.h:447: multiple definition of RedisModule_GetApi'; redisraft.o:/source/redisraft/redismodule.h:447: first defined here
/usr/bin/ld: common.o:/source/redisraft/redismodule.h:448: multiple definition of RedisModule_CreateCommand'; redisraft.o:/source/redisraft/redismodule.h:448: first defined here /usr/bin/ld: common.o:/source/redisraft/redismodule.h:449: multiple definition of RedisModule_SetModuleAttribs'; redisraft.o:/source/redisraft/redismodule.h:449: first defined here
[...snip many more unresolved symbols...]

natoscott added 2 commits July 1, 2020 17:57
Annotate module API functions in redismodule.h for use with -fno-common.

Relates to redis/redis#6900
Turn the existing __attribute__((unused)) and __attribute((__common__))
annotations into conditional macros for any compilers not accepting this
syntax.  These macros only expand to API annotations under gcc now.

Add use of __attribute__(format) to the RedisModule_CreateStringPrintf
API to provide type checking under gcc for modules using this interface.
natoscott added 2 commits July 3, 2020 11:23
config.c: In function ‘ConfigParseArgs’:
config.c:501:49: warning: format not a string literal and no format arguments [-Wformat-security]
             RedisModule_Log(ctx, REDIS_WARNING, errbuf);
@yossigo
Copy link
Collaborator

yossigo commented Aug 16, 2020

Pulled latest redismodule.h from Redis, thank you @natoscott !

@yossigo yossigo closed this Aug 16, 2020
sjpotter pushed a commit to sjpotter/redisraft that referenced this pull request Oct 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants