Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elftoolchain rework, update and change how we import things #196

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright 2021 Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License 2.0;
# you may not use this file except in compliance with the Elastic License 2.0.
set(CMAKE_VERBOSE_MAKEFILE ON)

cmake_minimum_required(VERSION 3.20)

Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ USER ?= $(shell whoami)
CURRENT_DATE_TAG ?= $(shell date +%Y%m%d-%H%M)
PKG_VERSION ?= $(shell cat VERSION)

# bmake Settings
MAKE_SYS_PATH ?= /usr/share/mk
export MAKESYSPATH = ${MAKE_SYS_PATH}

# Container Settings
NOCONTAINER ?=
BUILD_CONTAINER_IMAGE ?=
Expand Down
10 changes: 5 additions & 5 deletions cmake/modules/libelf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
# you may not use this file except in compliance with the Elastic License 2.0.


set(LIBELF_SRC "${PROJECT_SOURCE_DIR}/contrib/elftoolchain")
set(LIBELF_BUILD_DIR "${PROJECT_BINARY_DIR}/contrib/libelf")
set(LIBELF_LIB "${EBPF_INSTALL_DIR}/lib/libelf.a")
set(LIBELF_SRC "${PROJECT_SOURCE_DIR}/contrib/elftoolchain/libelf")
set(LIBELF_BUILD_DIR "${PROJECT_BINARY_DIR}/contrib/elftoolchain")
set(LIBELF_LIB "${EBPF_INSTALL_DIR}/lib/libelf_pic.a")

ExternalProject_Add(
libelf-external
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BINARY_DIR ${LIBELF_BUILD_DIR}
BUILD_COMMAND CC=${CMAKE_C_COMPILER} ${EBPF_EXT_ENV_FLAGS} BINOWN=${CURRENT_USER} BINGRP=${CURRENT_GROUP} MFLAGS= MAKEFLAGS= WITH_TESTS=no WITH_BUILD_TOOLS=no BUILD_STATIC_ONLY=1 WITH_ADDITIONAL_DOCUMENTATION=no WITH_PE=no WITH_ISA=no MAKEOBJDIR=${LIBELF_BUILD_DIR} INCSDIR=/include /bin/sh -c "bmake -j${NPROC} -C ${LIBELF_SRC} -e"
BUILD_COMMAND make -C ${LIBELF_SRC} V=1 MAKEOBJDIR=${LIBELF_BUILD_DIR}
INSTALL_COMMAND cp ${LIBELF_BUILD_DIR}/libelf/libelf_pic.a ${EBPF_INSTALL_DIR}/lib/libelf_pic.a
BUILD_IN_SOURCE 0
INSTALL_COMMAND CC=${CMAKE_C_COMPILER} ${EBPF_EXT_ENV_FLAGS} BINOWN=${CURRENT_USER} BINGRP=${CURRENT_GROUP} MFLAGS= MAKEFLAGS= WITH_TESTS=no WITH_BUILD_TOOLS=no BUILD_STATIC_ONLY=1 WITH_ADDITIONAL_DOCUMENTATION=no WITH_PE=no WITH_ISA=no MAKEOBJDIR=${LIBELF_BUILD_DIR} /bin/sh -c "bmake -j${NPROC} -C ${LIBELF_SRC} -e install DESTDIR=${EBPF_INSTALL_DIR} prefix='' INCSDIR=/include"
BUILD_BYPRODUCTS ${LIBELF_LIB}
)

Expand Down
31 changes: 0 additions & 31 deletions contrib/elftoolchain/.cirrus.yml

This file was deleted.

22 changes: 0 additions & 22 deletions contrib/elftoolchain/GNUmakefile

This file was deleted.

247 changes: 0 additions & 247 deletions contrib/elftoolchain/INSTALL

This file was deleted.

32 changes: 32 additions & 0 deletions contrib/elftoolchain/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Unless otherwise specified, the Elftoolchain
project's sources are distributed under a
2-clause BSD license.

SPDX short identifier: BSD-2-Clause

<<<--->>>
Copyright (c) 2006-2021, Elftoolchain Project Contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
<<<--->>>
Loading
Loading