mirror of
https://github.com/intel/linux-sgx
synced 2026-06-08 14:49:32 +00:00
6f0e20cfd9
* Adds libsgx_capable, which is currently only available in the Windows
version of the Intel SGX SDK. The Linux implementation of this library
adds the following functions:
sgx_status_t sgx_is_capable (int *sgx_capable);
sgx_status_t sgx_cap_get_status (sgx_device_status_t *sgx_device_status);
sgx_status_t sgx_cap_enable_device (sgx_device_status_t *sgx_device_status);
And adds the following error code (also from the Windows version of the
Intel SGX SDK):
SGX_ERROR_NO_PRIVILEGE
Generates both a static and dynamic build of libsgx_capable. This is
incorporated into the SDK package, not the PSW package, since software
installers need to check for Intel SGX capability on systems where the PSW
may not already be installed. This means that installers will either have
to statically link, or distribute the .so with their installation package.
----------------------
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: John P Mechalas <john.p.mechalas@intel.com>
72 lines
2.4 KiB
Makefile
72 lines
2.4 KiB
Makefile
#
|
|
# Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions
|
|
# are met:
|
|
#
|
|
# * Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# * 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.
|
|
# * Neither the name of Intel Corporation nor the names of its
|
|
# contributors may be used to endorse or promote products derived
|
|
# from this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
# "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
|
|
# OWNER OR CONTRIBUTORS 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.
|
|
#
|
|
#
|
|
|
|
include ../../../buildenv.mk
|
|
|
|
CXXFLAGS += -fPIC -Werror -g
|
|
CXXFLAGS += $(ADDED_INC)
|
|
|
|
CFLAGS += -fPIC -Werror -g
|
|
CFLAGS += $(ADDED_INC)
|
|
|
|
INC += -I$(COMMON_DIR)/inc \
|
|
-I$(COMMON_DIR)/inc/internal \
|
|
-I$(COMMON_DIR)/inc/internal/linux
|
|
|
|
LIB += -L$(BUILD_DIR)
|
|
|
|
LIBCAPABLE := libsgx_capable.so
|
|
LIBCAPABLE_STATIC := libsgx_capable.a
|
|
|
|
OBJ := sgx_capable.o
|
|
|
|
.PHONY: all
|
|
all: $(LIBCAPABLE) $(LIBCAPABLE_STATIC) | $(BUILD_DIR)
|
|
@$(CP) $(LIBCAPABLE) $|
|
|
@$(CP) $(LIBCAPABLE_STATIC) $|
|
|
|
|
$(LIBCAPABLE): $(OBJ)
|
|
$(CXX) $(CXXFLAGS) -shared -Wl,-soname=$@ $(LIB) -o $@ $(OBJ) $(LDFLAGS)
|
|
|
|
$(LIBCAPABLE_STATIC): $(OBJ)
|
|
$(AR) r $@ $?
|
|
|
|
%.o: %.cpp
|
|
$(CXX) -c $(CXXFLAGS) $(INC) $< -o $@
|
|
|
|
$(BUILD_DIR):
|
|
@$(MKDIR) $@
|
|
|
|
.PHONY: clean
|
|
clean::
|
|
@$(RM) *.o $(LIBCAPABLE) $(BUILD_DIR)/$(LIBCAPABLE)
|
|
@$(RM) $(LIBCAPABLE_STATIC) $(BUILD_DIR)/$(LIBCAPABLE_STATIC)
|