Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
d4a57f15
Commit
d4a57f15
authored
Jan 13, 2011
by
liujisi@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix corner case in acx_pthread.m4 to work with -nostdlib, patch from Kacper Kowalik.
parent
57014ffa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
acx_pthread.m4
m4/acx_pthread.m4
+34
-0
No files found.
m4/acx_pthread.m4
View file @
d4a57f15
...
...
@@ -340,6 +340,40 @@ if test "x$acx_pthread_ok" = xyes; then
acx_pthread_ok=no
fi
AC_MSG_CHECKING([whether what we have so far is sufficient with -nostdlib])
CFLAGS="-nostdlib $CFLAGS"
# we need c with nostdlib
LIBS="$LIBS -lc"
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[done=yes],[done=no])
if test "x$done" = xyes; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
if test x"$done" = xno; then
AC_MSG_CHECKING([whether -lpthread saves the day])
LIBS="-lpthread $LIBS"
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[done=yes],[done=no])
if test "x$done" = xyes; then
AC_MSG_RESULT([yes])
PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
else
AC_MSG_RESULT([no])
AC_MSG_WARN([Impossible to determine how to use pthreads with shared libraries and -nostdlib])
fi
fi
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
CC="$save_CC"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment