Skip to content

Commit

Permalink
Revert "add basic clang support for clangd"
Browse files Browse the repository at this point in the history
This reverts commit bdef92b.
  • Loading branch information
hhaim committed Aug 4, 2019
1 parent d2b110e commit 0256df1
Show file tree
Hide file tree
Showing 32 changed files with 440 additions and 637 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ linux_dpdk/trex-64.bz2
linux_dpdk/*.html
linux_dpdk/cov-int/*
*.vscode
*.clangd
compile_commands.json


linux/.waf*
linux/build*
Expand Down
2 changes: 1 addition & 1 deletion external_libs/bpf/bpf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bpf_run(bpf_h bpf, const char *buffer, uint32_t len) {
assert(len > 0);

const struct bpf_insn *fcode = program->bf_insns;
return bpf_filter(fcode, (const u_char *)buffer, len, len);
return bpf_filter(fcode, buffer, len, len);
}

#ifdef TREX_USE_BPFJIT
Expand Down
6 changes: 3 additions & 3 deletions external_libs/bpf/bpf_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
#include <sys/types.h>
#include <sys/time.h>

//#define SOLARIS (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
#if defined(__hpux) || (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
#define SOLARIS (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
#if defined(__hpux) || SOLARIS
# include <sys/sysmacros.h>
# include <sys/stream.h>
# define mbuf msgb
Expand Down Expand Up @@ -118,7 +118,7 @@
#endif

#if defined(KERNEL) || defined(_KERNEL)
#if !defined(__hpux) && !(defined(sun) && (defined(__SVR4) || defined(__svr4__)))
# if !defined(__hpux) && !SOLARIS
#include <sys/mbuf.h>
# endif
#define MINDEX(len, _m, _k) \
Expand Down
8 changes: 1 addition & 7 deletions external_libs/valijson/include/valijson/schema_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,11 +1224,8 @@ class SchemaParser
return dependenciesConstraint;
}

#ifndef __clang__
#pragma GCC push_options
#pragma GCC optimize ("O0")
#endif


/**
* @brief Make a new EnumConstraint object.
Expand All @@ -1254,10 +1251,7 @@ class SchemaParser
/// EnumConstraint class.
return constraint;
}

#ifndef __clang__
#pragma GCC pop_options
#endif

/**
* @brief Make a new ItemsConstraint object.
Expand Down Expand Up @@ -2114,7 +2108,7 @@ class SchemaParser
} // namespace valijson

#ifdef __clang__
#pragma clang diagnostic pop
# pragma clang diagnostic pop
#endif

#endif
70 changes: 0 additions & 70 deletions external_libs/waf-tools/clang_compilation_database.py

This file was deleted.

2 changes: 1 addition & 1 deletion linux/b
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

waf=waf-2.0.18
waf=waf-1.9.5
p2=${PYTHON:-${PYTHON2:-python2.7}}
p3=${PYTHON3:-python3}

Expand Down
Empty file modified linux/d
100755 → 100644
Empty file.
169 changes: 169 additions & 0 deletions linux/waf-1.9.5

Large diffs are not rendered by default.

173 changes: 0 additions & 173 deletions linux/waf-2.0.18

This file was deleted.

51 changes: 5 additions & 46 deletions linux/ws_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@
import os
import shutil
import copy
import sys

from distutils.version import StrictVersion
from waflib import Logs

sys.path.insert(0, os.path.abspath('waf-tools'))

top = '../'
out = 'build'
b_path ="./build/linux/"
Expand All @@ -31,16 +28,6 @@
GCC8_DIRS = ['/usr/local/gcc-8.3/bin']


clang_flags = [ '-Wno-null-conversion',
'-Wno-sign-compare',
'-Wno-strict-aliasing',
'-Wno-address-of-packed-member',
'-Wno-inconsistent-missing-override',
'-Wno-deprecated',
'-Wno-unused-private-field']

gcc_flags = ['-Wall', '-Wno-sign-compare', '-Wno-strict-aliasing']

class SrcGroup:
' group of source by directory '

Expand Down Expand Up @@ -115,9 +102,6 @@ def verify_cc_version (env, min_ver = REQUIRED_CC_VERSION):


def configure(conf):
conf.load('compiler_cxx')
conf.load('clang_compilation_database',tooldir=['../external_libs/waf-tools'])

if int(conf.options.gcc6) + int(conf.options.gcc7) + int(conf.options.gcc8) > 1:
conf.fatal('--gcc6, --gcc7 and --gcc8 are mutual exclusive')

Expand Down Expand Up @@ -156,19 +140,11 @@ def search_in_paths(paths):
if os.path.exists(path):
return path

def load_compiler(conf):
if 'clang' in conf.environ.get('CXX',''):
conf.load('clang++')
else:
conf.load('g++')
return



def configure_gcc(conf, explicit_paths = None):
# use the system path
if explicit_paths is None:
load_compiler(conf)
conf.load('g++')
return

if type(explicit_paths) is not list:
Expand All @@ -181,7 +157,7 @@ def configure_gcc(conf, explicit_paths = None):
saved = conf.environ['PATH']
try:
conf.environ['PATH'] = explicit_path
load_compiler(conf)
conf.load('g++')
finally:
conf.environ['PATH'] = saved

Expand Down Expand Up @@ -535,16 +511,6 @@ def __init__(self, name, src, debug_mode, is_pie, use = [], flags = [], rpath =
self.use = use
self.flags = flags
self.rpath = rpath
self.env = None

def set_env(self,env):
self.env = env;

def is_clang(self):
if self.env:
if 'clang' in self.env[0]:
return True
return False

def __str__(self):
s=self.mode+","+self.platform;
Expand Down Expand Up @@ -602,11 +568,6 @@ def update_name (self,name,delimiter):

def cxxcomp_flags (self,flags):
result = copy.copy(flags);

if self.is_clang():
result += clang_flags
else:
result += gcc_flags

if self.isIntelPlatform():
if self.is64Platform () :
Expand Down Expand Up @@ -679,14 +640,13 @@ def get_link_flags(self, is_sanitized):
return base_flags;



build_types = [
build_option(name = "bp-sim", src = bp, use = [''],debug_mode= DEBUG_, is_pie = False,
flags = ['-Werror'],
flags = ['-Wall', '-Werror', '-Wno-sign-compare', '-Wno-strict-aliasing'],
rpath = ['so']),

build_option(name = "bp-sim", src = bp, use = [''],debug_mode= RELEASE_, is_pie = False,
flags = ['-Werror'],
flags = ['-Wall', '-Werror', '-Wno-sign-compare', '-Wno-strict-aliasing'],
rpath = ['so']),

]
Expand All @@ -696,9 +656,8 @@ def build_prog (bld, build_obj):

# determine if sanitized image should be built
is_sanitized = bld.env.SANITIZED
build_obj.set_env(bld.env.CXX)

cxxflags = build_obj.get_flags(is_sanitized)+['-std=gnu++11']
cxxflags = build_obj.get_flags(is_sanitized)+['-std=gnu++11',]
linkflags = build_obj.get_link_flags(is_sanitized)


Expand Down
2 changes: 1 addition & 1 deletion linux_dpdk/b
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash

export WAFLOCK=.lock-wafbuild_dpdk
waf=waf-2.0.18
waf=waf-1.9.5
p2=${PYTHON:-${PYTHON2:-python2.7}}
p3=${PYTHON3:-python3}

Expand Down
Loading

0 comments on commit 0256df1

Please sign in to comment.