diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-07-06 12:48:56 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-07-06 12:48:56 -0700 |
commit | f4190c2f12527e37304f7c185afa0449fa9dee1c (patch) | |
tree | 356a2ab1431d08d161df80f03d7a45c088bccee6 /Makefile | |
parent | 1538aca5cbbd99be47657e0ca0b7e2186426a1b1 (diff) | |
download | mdadm-f4190c2f12527e37304f7c185afa0449fa9dee1c.tar.gz mdadm-f4190c2f12527e37304f7c185afa0449fa9dee1c.tar.xz mdadm-f4190c2f12527e37304f7c185afa0449fa9dee1c.zip |
mdmon: satisfy glibc tls abi requirements with pthreads
Setting up a proper tls descriptor is required to conform to the abi
[1]. Until it can be implemented in mdmon use pthreads instead of
clone(2) to let glibc handle the details. The old behaviour can be had
by un-defining USE_PTHREADS.
Note, the "O2" builds need LDFLAGS now to pick up the '-pthread' option.
[1]: http://people.redhat.com/drepper/tls.pdf
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -75,6 +75,14 @@ ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\" -DALT_MAPFILE=\"$(ALT_MAPFILE)\" VARFLAGS = -DVAR_RUN=\"$(VAR_RUN)\" CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(ALTFLAGS) $(VARFLAGS) +# The glibc TLS ABI requires applications that call clone(2) to set up +# TLS data structures, use pthreads until mdmon implements this support +USE_PTHREADS = 1 +ifdef USE_PTHREADS +CFLAGS += -DUSE_PTHREADS +LDFLAGS += -pthread +endif + # If you want a static binary, you might uncomment these # LDFLAGS = -static # STRIP = -s @@ -149,13 +157,13 @@ mdadm.klibc : $(SRCS) mdadm.h $(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS) mdadm.Os : $(SRCS) mdadm.h - $(CC) -o mdadm.Os $(CFLAGS) -DHAVE_STDINT_H -Os $(SRCS) + $(CC) -o mdadm.Os $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) mdadm.O2 : $(SRCS) mdadm.h mdmon.O2 - $(CC) -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) + $(CC) -o mdadm.O2 $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) mdmon.O2 : $(MON_SRCS) mdadm.h mdmon.h - $(CC) -o mdmon.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) + $(CC) -o mdmon.O2 $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) # use '-z now' to guarantee no dynamic linker interactions with the monitor thread mdmon : $(MON_OBJS) |