summaryrefslogtreecommitdiff
path: root/share/mk/bsd.lib.mk
AgeCommit message (Collapse)Author
2023-06-03bsd.*.mk: move MKSTRIPSYM default to bsd.own.mklukem
Add default for MKSTRIPSYM=yes to to bsd.own.mk _MKVARS.no. Test ${MKSTRIPSYM} != "no".
2023-05-28share/mk: finish USE_COMBINE, NOCOMBINE deprecationlukem
Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE, as gcc -combine has been EOL for many years. Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.
2023-05-09bsd.lib.mk: Nix trailing whitespace.riastradh
2023-05-08Allow linking against archives like PROGDPLIBS does.christos
2023-02-07fix code attempting to skip adding "-g" if "-g*" already is used.mrg
in bsd.lib.mk there's a check for "MKDEBUG != no" that will add -g to CFLAGS (maybe) and to CSHLIBFLAGS (always), given that it isn't in CFLAGS already.. except the conditional is "||" instead of "&&" and since the MKDEBUG/NODEBUG checks pass, the CFLAGS check isn't even performed. additionally, check CXXFLAGS as well as CFLAGS. this fixes the attempt to use "-g1" in the llvmrt build, which fails because the compile lines end up being "... -g1 .. -g ..", (the "-g" comes from the CSHLIBFLAGS variable in that case.) this reduces the size of llvm-enabled gallium debug by ~1.5GiB on amd64.
2022-03-29get rid of old style `` command substitution in shell and use $() instead.christos
2021-11-28For private and module libraries, build lint but do not install the lintchristos
libraries. We want to lint the private library code and we want to be able to link against the lint libraries, for example llib-largon2 from cgdconfig which is accessed via PROGDPLIBS.
2021-10-27revert previous: ↵ryo
http://mail-index.netbsd.org/source-changes/2021/10/25/msg133295.html going to add __always_inline to the functions called from _mcount() discussed on http://mail-index.netbsd.org/source-changes-d/2021/10/25/msg013480.html
2021-10-25In some arch, _mcount() would be called recursively when built with COPTS=-O0.ryo
Normally, functions called from mcount.c are expected to be expanded inline, so _mcount() will never be called recursively. But when build with COPTS=-O0, `static inline' functions aren't inlined, and _mcount() will be called recursively. Even if _mcount() has `__attribute__((__no_ instrument_function__))', it has no effect on the calling external (no-inlined) function. To avoid this, PROF.<fn> is added can be set the profiling flag of any file. "PROF.mcount.c" is set to blank by default, mcount.c itself is compiled without -pg.
2021-08-21fix some more typos in comments/log messages, improve wording as well.andvar
2020-11-09- make the CTFCONVERT command lines consistent and concise by putting allchristos
the implementation stuff in a variable CTFCONVERT_RUN - introduce an OBJECT_TARGET variable that contains the output object file - when we need to run ctfconvert, go through an intermediate ${.TARGET}.o file, instead of writing directly to ${.TARGET} and then overwriting ${.TARGET} with ctfconvert. This avoids build failures after a build got interrupted (the "partially built from C" scourge).
2020-06-011. if ${LIBISPRIVATE} == "pic", create _pic.a so that we can embed the librarychristos
to another shared object 2. Don't compare ${LIBISPRIVATE} to "yes", because there are 3 places in Makefiles which set it to empty (this was a bug) 3. For private libraries, don't create .so* files
2020-05-30Allow LIBISPRIVATE to build a pic version of itself for embedding intochristos
other shared libraries.
2020-05-10Pass -Wno-unused-command-line-argument for LLVM, discussed onmaxv
tech-toolchain@.
2019-08-27Enhance the support of LLVM sanitizerskamil
Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio code. This caused new build issued with duplicated symbols in few places and rump kernel code picking different code paths borrowed from libc. Handle all this in one go. Add bsd.sanitizer.mk to share common code used by programs and libraries. Switch from realall to beforeinstall target in .syms files. This is more reliable in MKSANITIZER.
2019-01-21Most of the mv operations are to move temporary files to their final place.christos
Some use -f, others don't. This can lead to spurious build failures when the user performing the build changes. Centralize, and always use -f.
2019-01-06Since g++ uses stdc++_p when building with -pg make this PIC on thechristos
platforms where PIC is available, so that linking shared objects with -pg works, without needing to create a shared library version of the profiled libraries.
2018-07-25Introduce MKLIBCSANITIZER in the share/mk ruleskamil
Add flags that are required to build a program and a dynamically loaded library. Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS. LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc and no external dependencies are needed. Register NOLIBCSANITIZER, as certain distribution parts will need to be skipped.
2018-06-25Add a framework for renaming symbols in libc&co for MKSANITIZERkamil
A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified a list of symbols to be renamed in a processor in order to remove naming conflicts with public symbols in libc/m/pthread/rt. This renaming will occur for libraries and programs. A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'. Based on an idea by <christos>
2018-06-21Refactor MKSANITIZER flags in mk ruleskamil
Introduce a new variable SANITIZERFLAGS that contains all the sanitizer specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS and LDFLAGS. Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS. Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a libraries are designed to construct .so libraries. All .so libraries with few exceptions are expected to be prebuilt with a sanitizer. Another purpuse of *_pic.a files can be constructing static PIE programs, however they are not supported as of now and there is no sanitization of static programs either. Once MKSTATICPIE will be supported, it will be initially incompatible with MKSANITIZER. This change also makes it easier to build other targets like kernel and kernel modules without userland sanitizers. No functional change intended for MKSANITIZER=no users.
2018-06-05Elide -nostdinc from LINK.c when linking object files since clang complainschristos
about unused argument. Note that we can't remove CPPFLAGS from LINK.c because it is used in the "shuttle rules" (from .c to executable).
2018-06-05Add rules for building relocatable objects to avoid having random Makefileschristos
use ${LD} ${LDFLAGS} -r which does not work if we specify MKRELRO since LDFLAGS is supposed to be passed to LINK.c not LD directly (although some of the flags work).
2017-05-29remove ugly profiling hack now that the compiler is fixed.christos
2017-05-23XXX: Remove -fPIE for profiled libraries because this breaks relocations forchristos
the call to __mcount.
2017-04-24fix another parallel-build race with MKDEBUG=yes by creating the .so.linkchs
with a temporary name and renaming to the final name only after the file is fully written.
2017-04-20Introduce MKSTRIPSYM build optionozaki-r
If it's yes, all local symbols of shared libraries are stripped (default). If it's no, only temporary local symbols are stripped; for example, symbols of static functions are kept. Keeping such symbols is useful on using DTrace for userland libraries and getting a backtrace from a rump server loading modules (shared libraries). Proposed and discussed on tech-kern and tech-toolchain
2017-01-08- centralize setting of MK* vars in bsd.own.mkchristos
- make sure that the default setting of all vars is done in _MKVARS.{yes,no} if possible.
2016-03-12remove conditionals that are always true with GCC >= 4.8.mrg
2016-02-27Revert and leave broken.christos
2016-02-27Don't build archive libs with -fPIC breaks static binaries and profilig.christos
2016-02-21Add NODEBUGchristos
2016-01-31Introduce NOPIE and NOCTF so that standalone programs build properly.christos
2015-09-08Revert previous. It was not wrong, but not necessary for everyone.uebayasi
(If really wanted, *.a generation rule can be easily overriden locally.)
2015-09-07Order object build alphabetically.uebayasi
2015-07-29Revert rev 1.359 which broke libsa builds. PR/50101tsutsui
2015-07-20Simplify the build of library archives by no longer doing a topologicaljoerg
sort.
2015-06-04fix MKDEBUG vs parallel builds. split the creation of the finalmrg
.so file from the main link of it, and use the main file as the input for both the .so output and the .so.debug file. for MKDEBUG builds we now: (a) create the (new) .so.full file (d) create the .so.debug file (c) create the (installable) .so file for other builds, we simply use the same rule for (a) to create (c). this stops the .so.debug rule from modifying the .so rule's target and leading to mayhem. see this thread for more details: http://mail-index.netbsd.org/tech-toolchain/2015/06/03/msg002616.html
2015-06-02Strip the debug symbols via a temporary file, atomically replacing the fullchristos
random access archive to avoid races.
2014-12-01PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilterh
if any of their dependencies (i.e. the files they refer to) are changed. This allows changes to transitive included headers to be handled properly.
2014-06-13remove the build support for GCC 4.1, and any hacks i found for it.mrg
there could still be more -- i only looked for lines matching both "HAVE_GCC" and "4" as words (grep -w.)
2014-04-24allow use with linkers that don't support --warn-shared-textrelpooka
(Solaris, OpenBSD)
2014-04-11Back changes from 1.349 on since the -Wl,-x bug has been fixed in binutils.matt
2014-04-11explain what's going on, add another kludge for -gchristos
2014-04-09Since the objcopy -x removes debugging symbols, delay that if we are buildingchristos
debugging libraries and do the stripping with the debug symbol separation step.
2014-04-09change -x to OBJCOPYLIBFLAGS like everywhere else.christos
2014-04-04Using -Wl,-x breaks build ARM BE8 shared libraries by striping the $a/$d/$tmatt
symbols before the linker can use them. Instead do ${OBJCOPY} -x ${.TARGET} afterwards.
2014-03-09let's see if the new dwarf library can handle dwarf 4christos
2014-03-02If we are compiling with -g and using gcc4.8 and dtrace downgradechristos
dwarf generation to version 2 for now.
2014-02-26define EXTERNAL_GCC_SUBDIR based upon HAVE_GCC, for GCC >= 4.5,mrg
and use it in the one place (bsd.lib.mk) it's used in share/mk.
2014-01-14Let MKARZERO default to the same value as MKREPRO, so callersapb
can set MKREPRO=yes and automatically get MKARZERO=yes.