Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
ab6a37f1
Commit
ab6a37f1
authored
Jun 09, 2015
by
Alexei Starovoitov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build with gcc < 4.9
Signed-off-by:
Alexei Starovoitov
<
ast@plumgrid.com
>
parent
f6b7c9b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
src/cc/CMakeLists.txt
src/cc/CMakeLists.txt
+3
-1
src/cc/kbuild_helper.h
src/cc/kbuild_helper.h
+5
-4
No files found.
src/cc/CMakeLists.txt
View file @
ab6a37f1
...
...
@@ -9,7 +9,9 @@ BISON_TARGET(Parser parser.yy ${CMAKE_CURRENT_BINARY_DIR}/parser.yy.cc COMPILE_F
FLEX_TARGET
(
Lexer lexer.ll
${
CMAKE_CURRENT_BINARY_DIR
}
/lexer.ll.cc COMPILE_FLAGS
"--c++ --o lexer.ll.cc"
)
ADD_FLEX_BISON_DEPENDENCY
(
Lexer Parser
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"-static-libstdc++ -Wl,--exclude-libs=ALL"
)
# if gcc 4.9 or higher is used, static libstdc++ is a good option
#set(CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -Wl,--exclude-libs=ALL")
set
(
CMAKE_SHARED_LINKER_FLAGS
"-Wl,--exclude-libs=ALL"
)
add_library
(
bpfprog SHARED bpf_common.cc bpf_module.cc codegen_llvm.cc
node.cc parser.cc printer.cc type_check.cc libbpf.c b_frontend_action.cc
...
...
src/cc/kbuild_helper.h
View file @
ab6a37f1
...
...
@@ -57,6 +57,10 @@ class DirStack {
char
cwd_
[
256
];
};
static
int
ftw_cb
(
const
char
*
path
,
const
struct
stat
*
,
int
)
{
return
::
remove
(
path
);
}
// Scoped class to manage the creation/deletion of tmpdirs
class
TmpDir
{
public:
...
...
@@ -69,10 +73,7 @@ class TmpDir {
ok_
=
true
;
}
~
TmpDir
()
{
auto
fn
=
[]
(
const
char
*
path
,
const
struct
stat
*
,
int
)
->
int
{
return
::
remove
(
path
);
};
if
(
::
ftw
(
prefix_
.
c_str
(),
fn
,
20
)
<
0
)
if
(
::
ftw
(
prefix_
.
c_str
(),
ftw_cb
,
20
)
<
0
)
::
perror
(
"ftw"
);
else
::
remove
(
prefix_
.
c_str
());
...
...
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