aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-02-24 16:45:04 +0100
committerLukas Larsson <[email protected]>2014-02-24 16:45:04 +0100
commita157ffce8e25012512e0e5d88e05fb135792f161 (patch)
tree8c2bf21e8a401f696483d6e7d08ff00dd805c06c /make
parent4ce83eb728748787f8a2da6155112c6da42a0eba (diff)
parent81abbc48e12317a07a8d2fcc041031c1c1567c8d (diff)
downloadotp-a157ffce8e25012512e0e5d88e05fb135792f161.tar.gz
otp-a157ffce8e25012512e0e5d88e05fb135792f161.tar.bz2
otp-a157ffce8e25012512e0e5d88e05fb135792f161.zip
Merge branch 'lukas/ose/master/OTP-11334'
* lukas/ose/master/OTP-11334: (71 commits) erts: Fix unix efile assert ose: Use -O2 when building ose: Expand OSE docs ose: Add dummy ttsl driver ose: Cleanup cleanup of mutex selection defines ose: Polish mmap configure checks ose: Add ose specific x-compile flags ose: Updating fd_driver and spawn_driver for OSE ose: Updating event and signal API for OSE ose: Cleanup of mutex selection defines win32: Compile erl_log.exe ose: Remove uneccesary define ose: Fix ssl configure test for osx erts: Fix sys_msg_dispatcher assert ose: Fix broken doc links ose: Thread priorities configurable from lmconf ose: Yielding the cpu is done "the OSE" way ose: Start using ppdata for tse key ose: Do not use spinlocks on OSE ose: Fix support for crypto ... Conflicts: lib/crypto/c_src/crypto.c
Diffstat (limited to 'make')
-rw-r--r--make/ose_lm.mk.in73
1 files changed, 73 insertions, 0 deletions
diff --git a/make/ose_lm.mk.in b/make/ose_lm.mk.in
new file mode 100644
index 0000000000..2e659ada1a
--- /dev/null
+++ b/make/ose_lm.mk.in
@@ -0,0 +1,73 @@
+#-*-makefile-*- ; force emacs to enter makefile-mode
+# ----------------------------------------------------
+# Template target for generating an OSE5 load module
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2013. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+# Author: Petre Pircalabu
+# ----------------------------------------------------
+
+# ----------------------------------------------------
+# build-ose-load-module
+# Creates an OSE5 load module
+# params:
+# $(1) - The output target
+# $(2) - Objects
+# $(3) - Libraries
+# $(4) - LM configuration file
+# ----------------------------------------------------
+
+ifeq ($(findstring ose,$(TARGET)),ose)
+LDR1FLAGS = @erl_xcomp_ose_ldflags_pass1@
+LDR2FLAGS = @erl_xcomp_ose_ldflags_pass2@
+OSEROOT = @erl_xcomp_ose_OSEROOT@
+LCF = @erl_xcomp_ose_LM_LCF@
+LMCONF = @erl_xcomp_ose_LM_CONF@
+STRIP = @erl_xcomp_ose_STRIP@
+LM_POST_LINK = @erl_xcomp_ose_LM_POST_LINK@
+LM_SET_CONF = @erl_xcomp_ose_LM_SET_CONF@
+LM_ELF_SIZE = @erl_xcomp_ose_LM_ELF_SIZE@
+OSE_CONFD = @erl_xcomp_ose_CONFD@
+CRT0_LM = @erl_xcomp_ose_CRT0_LM@
+endif
+
+define build-ose-load-module
+ @echo " --- Linking $(1)"
+
+ @echo " --- Linking $(1) (pass 1)"
+ $(ld_verbose)$(PURIFY) $(LD) -o $(1)_unconfigured_ro -r \
+ $(2) --start-group $(3) --end-group --cref --discard-none -M > $(1)_1.map
+
+ @echo " --- Linking $(1) (pass 2)"
+ $(ld_verbose)$(PURIFY) $(LD) -o $(1)_unconfigured \
+ $(1)_unconfigured_ro -T $(LCF) -n --emit-relocs -e crt0_lm --cref \
+ --discard-none -M > $(1)_2.map
+
+ @echo " --- Inserting configuration"
+ $(ld_verbose) $(LM_SET_CONF) $(1)_unconfigured < $(4)
+
+ @echo " --- Striping $(1)"
+# $(ld_verbose) $(STRIP) $(1)_unconfigured
+
+ @echo " --- Postlinking $(1)"
+ $(ld_verbose) $(LM_POST_LINK) $(1)_unconfigured
+
+ @echo " --- Sizing $(1)"
+ $(ld_verbose) $(LM_ELF_SIZE) $(1)_unconfigured
+ mv $(1)_unconfigured $(1)
+endef