Skip to content

Commit

Permalink
Compile compat/safebfuns.c with -O0
Browse files Browse the repository at this point in the history
Only very recent versions of clang support `optnone`, so this is the
best we can do until we can assume everyone has updated. See #6
  • Loading branch information
mikejsavage committed Dec 27, 2014
1 parent ff15043 commit 2922c1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
@@ -1,3 +1,5 @@
all: bcrypt.so

include Makefile.mess

SRCS += src/main.c
Expand All @@ -7,8 +9,6 @@ CFLAGS += -O2 -fPIC -DNDEBUG

OBJS := $(patsubst %.c,%.o,$(SRCS))

all: bcrypt.so

debug: CFLAGS += -ggdb3 -UNDEBUG
debug: all

Expand Down
3 changes: 3 additions & 0 deletions Makefile.mess
Expand Up @@ -42,3 +42,6 @@ endif
ifeq ($(uname),FreeBSD)
SRCS += compat/getentropy/getentropy_freebsd.c
endif

compat/safebfuns.o: compat/safebfuns.c
$(CC) $(CFLAGS) -O0 -c -o $@ $^
2 changes: 1 addition & 1 deletion compat/safebfuns.c
Expand Up @@ -8,7 +8,7 @@
* http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040627.html
*/
#if __has_attribute( noinline ) && __has_attribute( optnone )
#define NOOPT __attribute__ (( optnone ))
#define NOOPT /* __attribute__ (( optnone )) */
#define NOINLINE __attribute__ (( noinline ))
#else
#error "require clang with noinline and optnone attributes"
Expand Down

0 comments on commit 2922c1a

Please sign in to comment.