llvm.org GIT mirror llvm / ba62f2f
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. This kind of simplification is sometimes useful, but in general it's not correct. As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the build definitions used for FreeBSD, whereas for userland-related issues we want to match the definitions used for other systems with Glibc. The current modification adjusts the build system so that they can be distinguished, and explicitly adds GNU/kFreeBSD to the build checks in which it belongs. Fixes bug #16444. Patch by Robert Millan in the context of Debian. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185311 91177308-0d34-0410-b5e6-96231b3b80d8 Sylvestre Ledru 6 years ago
5 changed file(s) with 27 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
274274 BuildMode := Release
275275 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
276276 ifneq ($(HOST_OS),FreeBSD)
277 ifneq ($(HOST_OS),GNU/kFreeBSD)
277278 ifneq ($(HOST_OS),Darwin)
278279 OmitFramePointer := -fomit-frame-pointer
280 endif
279281 endif
280282 endif
281283
14501452 endif
14511453 endif
14521454
1453 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU))
1455 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU/kFreeBSD GNU))
14541456 ifneq ($(ARCH), Mips)
14551457 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
14561458 endif
221221 llvm_cv_no_link_all_option="-Wl,-noall_load"
222222 llvm_cv_os_type="Minix"
223223 llvm_cv_platform_type="Unix" ;;
224 *-*-freebsd* | *-*-kfreebsd-gnu)
224 *-*-freebsd*)
225225 llvm_cv_link_all_option="-Wl,--whole-archive"
226226 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
227227 llvm_cv_os_type="FreeBSD"
228 llvm_cv_platform_type="Unix" ;;
229 *-*-kfreebsd-gnu)
230 llvm_cv_link_all_option="-Wl,--whole-archive"
231 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
232 llvm_cv_os_type="GNU/kFreeBSD"
228233 llvm_cv_platform_type="Unix" ;;
229234 *-*-openbsd*)
230235 llvm_cv_link_all_option="-Wl,--whole-archive"
316321 llvm_cv_target_os_type="Darwin" ;;
317322 *-*-minix*)
318323 llvm_cv_target_os_type="Minix" ;;
319 *-*-freebsd* | *-*-kfreebsd-gnu)
324 *-*-freebsd*)
320325 llvm_cv_target_os_type="FreeBSD" ;;
326 *-*-kfreebsd-gnu)
327 llvm_cv_target_os_type="GNU/kFreeBSD" ;;
321328 *-*-openbsd*)
322329 llvm_cv_target_os_type="OpenBSD" ;;
323330 *-*-netbsd*)
38253825 llvm_cv_no_link_all_option="-Wl,-noall_load"
38263826 llvm_cv_os_type="Minix"
38273827 llvm_cv_platform_type="Unix" ;;
3828 *-*-freebsd* | *-*-kfreebsd-gnu)
3828 *-*-freebsd*)
38293829 llvm_cv_link_all_option="-Wl,--whole-archive"
38303830 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
38313831 llvm_cv_os_type="FreeBSD"
3832 llvm_cv_platform_type="Unix" ;;
3833 *-*-kfreebsd-gnu)
3834 llvm_cv_link_all_option="-Wl,--whole-archive"
3835 llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
3836 llvm_cv_os_type="GNU/kFreeBSD"
38323837 llvm_cv_platform_type="Unix" ;;
38333838 *-*-openbsd*)
38343839 llvm_cv_link_all_option="-Wl,--whole-archive"
39263931 llvm_cv_target_os_type="Darwin" ;;
39273932 *-*-minix*)
39283933 llvm_cv_target_os_type="Minix" ;;
3929 *-*-freebsd* | *-*-kfreebsd-gnu)
3934 *-*-freebsd*)
39303935 llvm_cv_target_os_type="FreeBSD" ;;
3936 *-*-kfreebsd-gnu)
3937 llvm_cv_target_os_type="GNU/kFreeBSD" ;;
39313938 *-*-openbsd*)
39323939 llvm_cv_target_os_type="OpenBSD" ;;
39333940 *-*-netbsd*)
207207 BuildMode := Release
208208 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
209209 ifneq ($(HOST_OS),FreeBSD)
210 ifneq ($(HOST_OS),GNU/kFreeBSD)
210211 ifneq ($(HOST_OS),Darwin)
211212 OmitFramePointer := -fomit-frame-pointer
213 endif
212214 endif
213215 endif
214216
13711373 endif
13721374 endif
13731375
1374 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1376 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU/kFreeBSD))
13751377 ifneq ($(ARCH), Mips)
13761378 LD.Flags += -Wl,--version-script=$(PROJ_SRC_ROOT)/autoconf/ExportMap.map
13771379 endif
6161 endif
6262 endif
6363
64 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU Bitrig))
64 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD OpenBSD GNU Bitrig))
6565 # Include everything from the .a's into the shared library.
6666 LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
6767 -Wl,--no-whole-archive
6868 endif
6969
70 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU))
70 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD GNU))
7171 # Add soname to the library.
7272 LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
7373 endif
7474
75 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU))
75 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD))
7676 # Don't allow unresolved symbols.
7777 LLVMLibsOptions += -Wl,--no-undefined
7878 endif