Skip to content

Commit 9396d52

Browse files
committed
Always compile jemalloc with cc
1 parent 540d2bb commit 9396d52

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

deps/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jemalloc/jemalloc/lib/libjemalloc.a:
3030
cd jemalloc && rm -rf jemalloc-3.6.0
3131
cd jemalloc && tar -jxf jemalloc-3.6.0.tar.bz2
3232
cd jemalloc/jemalloc && ./configure --enable-xmalloc
33-
cd jemalloc/jemalloc && CC=${CC} CXX=${CXX} ${MAKE}
33+
cd jemalloc/jemalloc && CC=cc ${MAKE}
3434

3535
jemalloc: jemalloc/jemalloc/lib/libjemalloc.a
3636

include/proxysql_debug.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ extern int gdbg;
1515
#endif
1616

1717
#ifdef DEBUG
18+
#ifdef HAVE_SYSCALL_H
1819
#define proxy_debug(module, verbosity, fmt, ...) \
1920
do { if (GloVars.global.gdbg) { \
2021
proxy_debug_func(module, verbosity, syscall(SYS_gettid), __FILE__, __LINE__, __func__ , fmt, ## __VA_ARGS__); \
2122
} } while (0)
2223
#else
2324
#define proxy_debug(module, verbosity, fmt, ...)
24-
#endif
25+
#endif /* HAVE_SYSCALL_H */
26+
#else
27+
#define proxy_debug(module, verbosity, fmt, ...)
28+
#endif /* DEBUG */
2529

2630
#ifdef DEBUG
2731
#define proxy_error(fmt, ...) \

lib/Makefile.BSD

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IDIRS=-I$(IDIR) -I$(JEMALLOC_IDIR) -I$(MARIADB_IDIR) $(LIBCONFIG_IDIR) -I$(RE2_I
3030

3131
LDIRS=-L$(JEMALLOC_PATH)/lib -L$(RE2_PATH)/obj -L$(INJECTION_PATH)
3232

33-
LIBS=-rdynamic -Wl,-Bstatic -ljemalloc_pic -lre2 -Wl,-Bdynamic -ldl -lpthread -lz -lrt -lc -lc++ -lstdc++ $(EXTRALINK)
33+
LIBS=-rdynamic -Wl,-Bstatic -ljemalloc_pic -lre2 -Wl,-Bdynamic -ldl -lpthread -lz -lrt -lc -lstdc++ $(EXTRALINK)
3434

3535
ODIR= obj
3636

src/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ _OBJ = main.o proxysql_global.o
7070
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
7171

7272
$(ODIR)/%.o: %.cpp
73-
$(CC) -c -o $@ $< $(CFLAGS) -Wall
73+
$(CXX) -c -o $@ $< $(CFLAGS) -Wall
7474

7575

7676

7777
proxysql: $(ODIR) $(OBJ) $(LIBPROXYSQLAR)
78-
$(CC) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CFLAGS) $(LDIRS) $(LIBS)
78+
$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CFLAGS) $(LDIRS) $(LIBS)
7979

8080
$(ODIR):
8181
mkdir $(ODIR)

src/Makefile.BSD

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ LDIRS=-L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(INJEC
5252

5353

5454
CFLAGS=-std=c++11 -D_GLIBCXX_USE_C99 $(IDIRS) $(OPTZ) $(DEBUG)
55-
LIBS=-rdynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -ljemalloc -lconfig++ -lre2 -linjection -levent -lmariadbclient -Wl,-Bdynamic -lpthread -lm -lz -lrt -lc -lc++ -lcrypto -lstdc++ -lssl -liconv -lexecinfo $(EXTRALINK)
55+
LIBS=-rdynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -ljemalloc -lconfig++ -lre2 -linjection -levent -lmariadbclient -Wl,-Bdynamic -lpthread -lm -lz -lrt -lc -lcrypto -lstdc++ -lssl -liconv -lexecinfo $(EXTRALINK)
5656
#LIBS=-rdynamic -Wl,-Bstatic -lproxysql -ljemalloc -levent $(GLIB_LIB) -Wl,-Bdynamic -ldl -lpthread -lm -lz -lrt
5757

5858
LIBPROXYSQLAR=$(LDIR)/libproxysql.a
@@ -70,12 +70,12 @@ _OBJ = main.o proxysql_global.o
7070
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
7171

7272
$(ODIR)/%.o: %.cpp
73-
$(CC) -c -o $@ $< $(CFLAGS) -Wall
73+
$(CXX) -c -o $@ $< $(CFLAGS) -Wall
7474

7575

7676

7777
proxysql: $(ODIR) $(OBJ) $(LIBPROXYSQLAR)
78-
$(CC) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CFLAGS) $(LDIRS) $(LIBS)
78+
$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CFLAGS) $(LDIRS) $(LIBS)
7979

8080
$(ODIR):
8181
mkdir $(ODIR)

0 commit comments

Comments
 (0)