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

Fix libuwind target with pthreads #784

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonringer
Copy link

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
Contributor

Thanks 🙏🏻

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

@lzha101
Copy link
Contributor

lzha101 commented Jan 24, 2022

One question, are you parallelly building the sdk via make -jN? In the cpprt Makefile,

prepare-libunwind:
$(CP) linux/pthread_compat.h $(LIBUNWIND_DIR)/include
$(CPPRT): $(OBJS) prepare-libunwind libunwind
$(CP) $(LIBUNWIND_DIR)/src/.libs/libunwind.a $(CPPRT)
$(AR) rs $@ $(OBJS)

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
Author

If you are building the SDK with make -j

Yes, I'm doing make -j32 -l32

@lzha101
Copy link
Contributor

lzha101 commented Feb 10, 2022

@jonringer Can you try to change the Makefile

$(CPPRT): $(OBJS) prepare-libunwind libunwind
$(CP) $(LIBUNWIND_DIR)/src/.libs/libunwind.a $(CPPRT)
$(AR) rs $@ $(OBJS)
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants