Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
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
2 changes: 1 addition & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ test/shared/.run: $(DRUNTIMESO)
test/%/.run: test/%/Makefile
$(QUIET)$(MAKE) -C test/$* MODEL=$(MODEL) OS=$(OS) DMD=$(abspath $(DMD)) BUILD=$(BUILD) \
DRUNTIME=$(abspath $(DRUNTIME)) DRUNTIMESO=$(abspath $(DRUNTIMESO)) LINKDL=$(LINKDL) \
QUIET=$(QUIET) TIMELIMIT='$(TIMELIMIT)'
QUIET=$(QUIET) TIMELIMIT='$(TIMELIMIT)' PIC=$(PIC)

#################### test for undesired white spaces ##########################
MANIFEST = $(shell git ls-tree --name-only -r HEAD)
Expand Down
4 changes: 3 additions & 1 deletion test/common.mak
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ SRC:=src
GENERATED:=./generated
ROOT:=$(GENERATED)/$(OS)/$(BUILD)/$(MODEL)

OPTIONAL_PIC:=$(if $(PIC),-fPIC,)
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to explicitly pass OPTIONAL_PIC=$(OPTIONAL_PIC) from the top makefile as is done for the other variables above.
See

druntime/posix.mak

Lines 264 to 266 in 4af3423

$(QUIET)$(MAKE) -C test/$* MODEL=$(MODEL) OS=$(OS) DMD=$(abspath $(DMD)) BUILD=$(BUILD) \
DRUNTIME=$(abspath $(DRUNTIME)) DRUNTIMESO=$(abspath $(DRUNTIMESO)) LINKDL=$(LINKDL) \
QUIET=$(QUIET) TIMELIMIT='$(TIMELIMIT)'
.
The fact that explict CLI arguments (like PIC=1) are passed to proper submake invocations is fairly subtle to rely on.

Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay. I just added it as an argument.

Copy link
Contributor

@Burgos Burgos Jul 9, 2017

Choose a reason for hiding this comment

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

@jmdavis why not pass OPTIONAL_PIC (as @MartinNowak suggested), instead of PIC, so the OPTIONAL_PIC doesn't need to be calculated again?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought that I had done what was requested, but I could have misunderstood, and my makefile-foo is quite weak.


ifneq (default,$(MODEL))
MODEL_FLAG:=-m$(MODEL)
endif
CFLAGS:=$(MODEL_FLAG) -Wall
DFLAGS:=$(MODEL_FLAG) -w -I../../src -I../../import -I$(SRC) -defaultlib= -debuglib= -dip1000
DFLAGS:=$(MODEL_FLAG) -w -I../../src -I../../import -I$(SRC) -defaultlib= -debuglib= -dip1000 $(OPTIONAL_PIC)
# LINK_SHARED may be set by importing makefile
DFLAGS+=$(if $(LINK_SHARED),-L$(DRUNTIMESO),-L$(DRUNTIME))
ifeq ($(BUILD),debug)
Expand Down