Browse Source

Not working python commit

dettanym 5 years ago
parent
commit
9b4c7ce40c
2 changed files with 6 additions and 6 deletions
  1. 4 4
      Makefile
  2. 2 2
      systemMain.cpp

+ 4 - 4
Makefile

@@ -1,10 +1,10 @@
 CXX             = g++
 RM              = rm -f
-PYTHON_CFLAGS = -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7  -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG -g -fwrapv 
-PYTHON_LDFLAGS = -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7 -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
+PYTHON_CFLAGS = -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7  -Wdate-time #-fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG -g -fwrapv 
+PYTHON_LDFLAGS = -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7   -lutil #-ldl -lm  #-Wl,-export-dynamic -Wl,-Bsymbolic-functions
 CXX_FLAGS       = -Wall  -O2 -std=c++11 -fpic -fdata-sections -ffunction-sections ${PYTHON_CFLAGS}
 LD              = ${CXX} -v
-LD_FLAGS        = -Wall -O2 ${PYTHON_LDFLAGS}
+LD_FLAGS        = -Wall ${PYTHON_LDFLAGS}
 
 all_non_sgx_obj := $(system_obj) $(protobuf_obj) #$(patsubst %.cpp,%.o,$(all_non_sgx_cpp)}
 
@@ -46,7 +46,7 @@ crypto.o: crypto.cpp
 
 verifier:  systemMain.o systemSealerWrapper.o SgxSealer.o ProtobufLAInitiator.o SgxProtobufLAInitiator.o SgxProtobufLAInitiator_Transforms.o ProtobufLAMessages.pb.o crypto.o
 #	echo $(system_obj)
-	${CXX} -Wl,--no-undefined  systemMain.o crypto.o  -L${Openssl_Path}/lib -lcrypto -lssl  ${LD_FLAGS} -o $@ 
+	${CXX} -Wl,--no-undefined  systemMain.o crypto.o systemSealerWrapper.o SgxSealer.o  -L${Openssl_Path}/lib -lcrypto -lssl -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive  -L$(SGX_LIBRARY_PATH) -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc ${LD_FLAGS} -o $@ 
 
 #-Wl,-rpath,$(SGX_SDK)/lib64  systemMain.o  ${LD_FLAGS} -o $@
 #systemSealerWrapper.o SgxSealer.o 

+ 2 - 2
systemMain.cpp

@@ -101,7 +101,7 @@ int main(int argc, char** argv)
 */
 
   printf("HELLOWORLD\n");fflush(stdout); 
-//  Py_SetProgramName("verifier");  /* optional but recommended */
+//  Py_SetProgramName("verifier");  
   printf("HELLOWORLD 2\n"); fflush(stdout); 
   Py_Initialize();
   printf("HELLOWORLD 3\n");fflush(stdout); 
@@ -139,7 +139,7 @@ int main(int argc, char** argv)
 	printf("Could not generate RSA keypair - error 0x%x\n", return_internal); fflush(stdout); return return_internal; 
   }
   printf("Generated key pair - outside the fun\n"); fflush(stdout); 
-/*  int sealed_file_fd = open("sealed_msg.txt", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+  int sealed_file_fd = open("sealed_msg.txt", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
   if(sealed_file_fd == -1)
   {
     perror("\nError in opening or creating the file sealed_msg.txt - ");