Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
91be5946
Commit
91be5946
authored
Aug 21, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complement compilation options according to gcc version
parent
31d45c20
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
Makefile
Makefile
+11
-1
config_brpc.sh
config_brpc.sh
+3
-0
print_gcc_version.cc
tools/print_gcc_version.cc
+9
-0
No files found.
Makefile
View file @
91be5946
...
@@ -14,7 +14,17 @@ LIBPATHS = $(addprefix -L, $(LIBS))
...
@@ -14,7 +14,17 @@ LIBPATHS = $(addprefix -L, $(LIBS))
SRCEXTS
=
.c .cc .cpp .proto
SRCEXTS
=
.c .cc .cpp .proto
HDREXTS
=
.h .hpp
HDREXTS
=
.h .hpp
ifeq
($(shell
test
$(shell
$(CXX)
-dumpversion
|
sed
-e
's/\..*$$//g'
)
-ge
7;
echo
$$?),0)
# strict-aliasing in gcc4.4 in buggy
ifeq
($(shell
echo
$$(($(GCC_VERSION)/
100))),
404)
CXXFLAGS
+=
-Wno-strict-aliasing
CFLAGS
+=
-Wno-strict-aliasing
endif
#required by base/crc32.cc to boost performance for 10x
ifeq
($(shell
test
$(GCC_VERSION)
-ge
40400;
echo
$$?),0)
CXXFLAGS
+=
-msse4
-msse4
.2
endif
#not solved yet
ifeq
($(shell
test
$(GCC_VERSION)
-ge
70000;
echo
$$?),0)
CXXFLAGS
+=
-Wno-aligned-new
CXXFLAGS
+=
-Wno-aligned-new
endif
endif
...
...
config_brpc.sh
View file @
91be5946
...
@@ -26,6 +26,8 @@ while true; do
...
@@ -26,6 +26,8 @@ while true; do
esac
esac
done
done
GCC_VERSION
=
$(
$CXX
tools/print_gcc_version.cc
-o
print_gcc_version
&&
./print_gcc_version
&&
rm
./print_gcc_version
)
if
[
-z
"
$HDRS_IN
"
]
||
[
-z
"
$LIBS_IN
"
]
;
then
if
[
-z
"
$HDRS_IN
"
]
||
[
-z
"
$LIBS_IN
"
]
;
then
>
&2
$ECHO
"config_brpc: --headers=HDRPATHS --libs=LIBPATHS must be specified"
>
&2
$ECHO
"config_brpc: --headers=HDRPATHS --libs=LIBPATHS must be specified"
exit
1
exit
1
...
@@ -163,6 +165,7 @@ append_to_output "PROTOC=$PROTOC"
...
@@ -163,6 +165,7 @@ append_to_output "PROTOC=$PROTOC"
append_to_output
"PROTOBUF_HDR=
$PROTOBUF_HDR
"
append_to_output
"PROTOBUF_HDR=
$PROTOBUF_HDR
"
append_to_output
"CC=
$CC
"
append_to_output
"CC=
$CC
"
append_to_output
"CXX=
$CXX
"
append_to_output
"CXX=
$CXX
"
append_to_output
"GCC_VERSION=
$GCC_VERSION
"
append_to_output
"STATIC_LINKINGS=
$STATIC_LINKINGS
"
append_to_output
"STATIC_LINKINGS=
$STATIC_LINKINGS
"
append_to_output
"DYNAMIC_LINKINGS=
$DYNAMIC_LINKINGS
"
append_to_output
"DYNAMIC_LINKINGS=
$DYNAMIC_LINKINGS
"
...
...
tools/print_gcc_version.cc
0 → 100644
View file @
91be5946
#include <stdio.h>
int
main
()
{
#if defined(__GNUC__)
printf
(
"%d
\n
"
,
(
__GNUC__
*
10000
+
__GNUC_MINOR__
*
100
+
__GNUC_PATCHLEVEL__
));
#else
printf
(
"0
\n
"
);
#endif
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment