Skip to content

Fix libuwind target with pthreads - #784

Open
jonringer wants to merge 1 commit into
intel:mainfrom
jonringer:fix-linux-pthreads
Open

Fix libuwind target with pthreads#784
jonringer wants to merge 1 commit into
intel:mainfrom
jonringer:fix-linux-pthreads

Conversation

@jonringer

Copy link
Copy Markdown

To fix:

In file included from ../include/libunwind_i.h:52,
                 from os-linux.c:29:
../include/pthread.h:37:10: fatal error: pthread_compat.h: No such file or directory
   37 | #include "pthread_compat.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

@jonringer jonringer mentioned this pull request Jan 22, 2022
13 tasks
@veehaitch

Copy link
Copy Markdown
Contributor

Thanks 🙏🏻

I believe Intel is going to insist on the Signed-off-by trailer at the end of the commit log message.

@lzha101

lzha101 commented Jan 24, 2022

Copy link
Copy Markdown
Contributor

One question, are you parallelly building the sdk via make -jN? In the cpprt Makefile, https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/cpprt/Makefile#L75-L81

You can see the pthread_compat.h will be copied to sdk/cpprt/linux/libunwind/include. If you are building the SDK with make -j, we can just change the upper Makefile to make sure the order that the copy action is before libunwind build.
I guess we not adding sdk/cpprt/linux to the libunwind Makefile is to avoid wrong header file included by mistake as you can see there are some header files in both sdk/cpprt/linux and sdk/cpprt/linux/libunwind/include, such as unwind.h.

@jonringer

Copy link
Copy Markdown
Author

If you are building the SDK with make -j

Yes, I'm doing make -j32 -l32

@lzha101

lzha101 commented Feb 10, 2022

Copy link
Copy Markdown
Contributor

@jonringer Can you try to change the Makefile https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/cpprt/Makefile#L78-L80 to:

$(CPPRT): $(OBJS) prepare-libunwind
        $(Make) libunwind
	$(CP) $(LIBUNWIND_DIR)/src/.libs/libunwind.a $(CPPRT)
	$(AR) rs $@ $(OBJS)

And see if the above change could fix your problem?

@bot-cc1s-branch-sync

Copy link
Copy Markdown
Contributor

Important

🔀 The Intel® SGX SDK codebase has moved

Thank you for your contribution!
The code this pull request modifies now resides in a new repository,1 so, unfortunately, it can no longer be merged here as-is. If your change is still relevant, please re-open it against the SDK repository, where this code is now maintained.

If you have any questions or need assistance migrating, please ask here. As we complete the migration, older pull requests may eventually be closed. No work is lost, though, and you are welcome to re-open your change in the new repository at any time.

Footnotes

  1. The affected sources were migrated from confidential-computing.sgx to the dedicated confidential-computing.sgx.sdk repo. The migration covered the SDK sources (sdk/), shared headers (common/), samples (SampleCode/), and the runtime libraries (psw/urts, psw/enclave_common).

@bot-cc1s-branch-sync bot-cc1s-branch-sync added the repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting) label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants