Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: native_client_sdk/src/tools/nacl_gcc.mk

Issue 240493003: Support static/dynamic for bionic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enable bionic static/dynamic and nacl_io test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # 5 #
6 # GNU Make based build file. For details on GNU Make see: 6 # GNU Make based build file. For details on GNU Make see:
7 # http://www.gnu.org/software/make/manual/make.html 7 # http://www.gnu.org/software/make/manual/make.html
8 # 8 #
9 9
10 # 10 #
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ifeq (,$(MULTI_PLATFORM)) 66 ifeq (,$(MULTI_PLATFORM))
67 X86_32_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_x86_32.map 67 X86_32_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_x86_32.map
68 X86_64_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_x86_64.map 68 X86_64_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_x86_64.map
69 ARM_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_arm.map 69 ARM_LDFLAGS ?= -Wl,-Map,$(OUTDIR)/$(TARGET)_arm.map
70 else 70 else
71 X86_32_LDFLAGS ?= -Wl,-Map,$(X86_32_OUTDIR)/$(TARGET)_x86_32.map 71 X86_32_LDFLAGS ?= -Wl,-Map,$(X86_32_OUTDIR)/$(TARGET)_x86_32.map
72 X86_64_LDFLAGS ?= -Wl,-Map,$(X86_64_OUTDIR)/$(TARGET)_x86_64.map 72 X86_64_LDFLAGS ?= -Wl,-Map,$(X86_64_OUTDIR)/$(TARGET)_x86_64.map
73 ARM_LDFLAGS ?= -Wl,-Map,$(ARM_OUTDIR)/$(TARGET)_arm.map 73 ARM_LDFLAGS ?= -Wl,-Map,$(ARM_OUTDIR)/$(TARGET)_arm.map
74 endif 74 endif
75 75
76 #
77 # Choose between static and dynamic linking for Bionic
78 # (Default to dynamic)
79 #
80 ifeq (,$(BIONIC_USE_DYNAMIC))
81 BIONIC_LINK:=-static
82 else
83 BIONIC_LINK:=-Wl,-Ttext-segment=0x100000
84 endif
85
86
76 LDFLAGS_SHARED = -shared 87 LDFLAGS_SHARED = -shared
77 88
78 # 89 #
79 # Compile Macro 90 # Compile Macro
80 # 91 #
81 # $1 = Source Name 92 # $1 = Source Name
82 # $2 = Compile Flags 93 # $2 = Compile Flags
83 # 94 #
84 define C_COMPILER_RULE 95 define C_COMPILER_RULE
85 -include $(call SRC_TO_DEP,$(1),_x86_32) 96 -include $(call SRC_TO_DEP,$(1),_x86_32)
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 $(X86_64_OUTDIR)/$(1)_x86_64.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_ x86_64)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp) 359 $(X86_64_OUTDIR)/$(1)_x86_64.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_ x86_64)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
349 $(MKDIR) -p $$(dir $$@) 360 $(MKDIR) -p $$(dir $$@)
350 $(call LOG,LINK,$$@,$(X86_64_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFL AGS) $(X86_64_LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFI G)) $(foreach lib,$(3),-l$(lib)) $(5)) 361 $(call LOG,LINK,$$@,$(X86_64_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFL AGS) $(X86_64_LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFI G)) $(foreach lib,$(3),-l$(lib)) $(5))
351 $(call LOG,VALIDATE,$$@,$(NCVAL) $$@) 362 $(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
352 endif 363 endif
353 364
354 ifneq (,$(findstring arm,$(ARCHES))) 365 ifneq (,$(findstring arm,$(ARCHES)))
355 all: $(ARM_OUTDIR)/$(1)_arm.nexe 366 all: $(ARM_OUTDIR)/$(1)_arm.nexe
356 $(ARM_OUTDIR)/$(1)_arm.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp) 367 $(ARM_OUTDIR)/$(1)_arm.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
357 $(MKDIR) -p $$(dir $$@) 368 $(MKDIR) -p $$(dir $$@)
358 » $(call LOG,LINK,$$@,$(ARM_LINK) -static -o $$@ $$(filter %.o,$$^) $(NACL _LDFLAGS) $(ARM_LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG )) $(foreach lib,$(3),-l$(lib)) $(5)) 369 » $(call LOG,LINK,$$@,$(ARM_LINK) $(BIONIC_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_arm/$ (CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
binji 2014/04/28 21:01:22 won't this affect arm newlib as well?
noelallen1 2014/04/28 23:00:33 Done.
359 $(call LOG,VALIDATE,$$@,$(NCVAL) $$@) 370 $(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
360 endif 371 endif
361 endef 372 endef
362 373
363 374
364 # 375 #
365 # Generalized Link Macro 376 # Generalized Link Macro
366 # 377 #
367 # $1 = Target Name 378 # $1 = Target Name
368 # $2 = List of Sources 379 # $2 = List of Sources
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) 556 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set)
546 endif 557 endif
547 $(SEL_LDR_PATH) $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS) 558 $(SEL_LDR_PATH) $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS)
548 559
549 debug: all 560 debug: all
550 ifndef NACL_ARCH 561 ifndef NACL_ARCH
551 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) 562 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set)
552 endif 563 endif
553 $(SEL_LDR_PATH) -d $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS) 564 $(SEL_LDR_PATH) -d $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe -- $(EXE_ARGS)
554 endif 565 endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698