Files
my-rook-config/build/makelib/cross.mk
T
Bassam Tabbara 75523ccb17 build: add support debug builds and backtraces
we now build with debug information on linux even for release builds. Debug
information is save in a separate .debug file that can be loaded by gdb.

switched to using the golangs's facilities for cgo backtraces. had to add
C++ demangling to it but its now on par with the default backtrace facility
that ceph had. This approach works with static builds and relies on the
symbol table alone -- no need for rdynamic or DWARF sections in the binary.

Update the build container so that all packages now build with debug, also
fixed zlib package which had a broken link.

Fixes #135
2017-02-09 19:52:27 -08:00

48 lines
1.4 KiB
Makefile

# Copyright 2016 The Rook Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ====================================================================================
# Makefile helper functions for cross compiling
#
ifeq ($(GOOS)_$(GOARCH),linux_amd64)
CROSS_TRIPLE=x86_64-linux-gnu
CC=$(CROSS_TRIPLE)-gcc
CXX=$(CROSS_TRIPLE)-g++
OBJCOPY=$(CROSS_TRIPLE)-objcopy
endif
ifeq ($(GOOS)_$(GOARCH),linux_arm64)
CROSS_TRIPLE=aarch64-linux-gnu
CC=$(CROSS_TRIPLE)-gcc
CXX=$(CROSS_TRIPLE)-g++
OBJCOPY=$(CROSS_TRIPLE)-objcopy
endif
ifeq ($(GOOS)_$(GOARCH),darwin_amd64)
CROSS_TRIPLE=x86_64-apple-darwin15
CC=$(CROSS_TRIPLE)-clang
CXX=$(CROSS_TRIPLE)-clang++
OBJCOPY=$(CROSS_TRIPLE)-objcopy
endif
ifeq ($(CEPHD_PLATFORM),windows_amd64)
CROSS_TRIPLE=x86_64-w64-mingw32
CC=$(CROSS_TRIPLE)-gcc
CXX=$(CROSS_TRIPLE)-g++
OBJCOPY=$(CROSS_TRIPLE)-objcopy
endif
export CC CXX OBJCOPY