• Yonghong Song's avatar
    Change clang frontend optimization level from 0 to 2 · 42c00adb
    Yonghong Song authored
    The issue is caused by the following clang change on 5.0:
    https://reviews.llvm.org/D28404
    
    Basically, at -O0, unless always inlining is specified, a
    function will be marked as optnone and noinline.
    
    This causes two kinds of issues: (1). optnone will generate
    suboptimal code with heavy stack use and this high likely can
    cause verifier failure; and (2). even if user mark all his/her
    defined functions in bpf program as always inlining, some
    functions in linux header files are not marked as always inline
    and hence will be marked as noinline instead, ultimately
    causing llvm complaining about global function reference.
    
    This patch bumps the clang optimization level to -O2.
    This should work with older versions of llvm as well.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    42c00adb
loader.cc 10.9 KB