Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

CC = gcc
CC = cc
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: I did not guard this. Problem?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specific flags we use assume GCC on Linux and apparently clang on macOS? If so, I guess you need to move the CC = line to inside the ifeq/else, and the LD line to after endif.

Also, e.g. on Solaris cc may be Sun's compiler, which does not recognize gcc options, yet I fixed this Makefile to work for Solaris just recently... except that I also broke it on SPARC later by adding -march=native, which gcc for that arch does not recognize.

Comment thread
peturingi marked this conversation as resolved.
LD = $(CC)
RM = rm -f
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
OMPFLAGS = -Xpreprocessor -fopenmp -I$(shell brew --prefix libomp)/include
OMPFLAGS_MAYBE = $(OMPFLAGS)
CFLAGS = -Wall -O2 -fomit-frame-pointer $(OMPFLAGS_MAYBE) -DSKIP_MEMZERO
LDFLAGS = -L$(shell brew --prefix libomp)/lib -lomp $(OMPFLAGS_MAYBE)
Comment thread
peturingi marked this conversation as resolved.
Comment thread
peturingi marked this conversation as resolved.
else
OMPFLAGS = -fopenmp
OMPFLAGS_MAYBE = $(OMPFLAGS)
#CFLAGS = -Wall -O2 -fomit-frame-pointer $(OMPFLAGS_MAYBE) -DSKIP_MEMZERO
CFLAGS = -Wall -O2 -march=native -fomit-frame-pointer $(OMPFLAGS_MAYBE) -DSKIP_MEMZERO
#CFLAGS = -Wall -O2 -funroll-loops -fomit-frame-pointer $(OMPFLAGS_MAYBE) -DSKIP_MEMZERO
#CFLAGS = -Wall -O2 -march=native -funroll-loops -fomit-frame-pointer $(OMPFLAGS_MAYBE) -DSKIP_MEMZERO
# -lrt is for userom's use of clock_gettime()
LDFLAGS = -s -lrt $(OMPFLAGS_MAYBE)
endif

PROJ = tests phc-test initrom userom
OBJS_CORE = yescrypt-opt.o
Expand Down
2 changes: 2 additions & 0 deletions userom.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ int main(int argc, const char * const *argv)

unsigned long long count1 = count, count_restart = 0;

#ifndef __APPLE__
Copy link
Copy Markdown
Member

@solardiz solardiz May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try #ifdef SCHED_RR.

if (!geteuid()) {
puts("Running as root, so trying to set SCHED_RR");
#pragma omp parallel
Expand All @@ -306,6 +307,7 @@ int main(int argc, const char * const *argv)
perror("sched_setscheduler");
}
}
#endif

start = times(&start_tms);

Expand Down
Loading