VirtualBox

Changeset 3623 in vbox


Ignore:
Timestamp:
Jul 16, 2007 2:26:57 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22893
Message:

FreeBSD variant of VBOXR0DRV.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r3597 r3623  
    14271427endif
    14281428
    1429 ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)  # pure guess work just to avoid the warning below
     1429ifeq ($(BUILD_TARGET),freebsd)
     1430# x86 FreeBSD:
     1431#  cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \
     1432#   -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \
     1433#   -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \
     1434#   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \
     1435#   -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \
     1436#   -std=c99 -c ../my.c
     1437#  ld -d -warn-common -r -d -o my.kld my.o
     1438#  :> export_syms
     1439#  awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld
     1440#  ld -Bsharable -d warn-commnon -o my.ko my.kld
     1441#
     1442# Note: @ -> /usr/src/sys  and  machine -> /usr/src/sys/i386/include
     1443
     1444## The location of the FreeBSD kernel source.
     1445VBOX_FREEBSD_SRC ?= /usr/src/sys
     1446## The FreeBSD /usr/include.
     1447VBOX_FREEBSD_SYS_INCS ?= /usr/include
     1448
    14301449TEMPLATE_VBOXR0DRV_TOOL                = $(VBOX_GCC_TOOL)
    1431 TEMPLATE_VBOXR0DRV_DEFS                = __KERNEL__ IN_RING0 IN_RT_R0
    1432 TEMPLATE_VBOXR0DRV_CFLAGS              = \
    1433         -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
    1434         $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
    1435 TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -msoft-float
    1436 TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
    1437         -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
    1438         -Wno-sign-compare -Wdeclaration-after-statement
    1439 TEMPLATE_VBOXR0DRV_CXXFLAGS            = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
     1450TEMPLATE_VBOXR0DRV_LDTOOL              = FREEBSDKMODLD
     1451TEMPLATE_VBOXR0DRV_DEFS                = _KERNEL KLD_MODULE IN_RING0 IN_RT_R0
     1452TEMPLATE_VBOXR0DRV_INCS                = \
     1453        $(VBOX_FREEBSD_SRC) \
     1454        $(VBOX_FREEBSD_SRC)/contrib/altq \
     1455        $(VBOX_FREEBSD_SRC)/../include \
     1456        $(VBOX_FREEBSD_SYS_INCS)
     1457# omitting: -Wcast-qual, -Wredundant-decls
     1458TEMPLATE_VBOXR0DRV_CFLAGS              =  \
     1459        -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
     1460        -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
     1461        -O2 -fformat-extensions -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
     1462        $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
     1463        -nostdinc -std=c99
     1464TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
     1465TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 "Port me to amd64 FreeBSD"
     1466TEMPLATE_VBOXR0DRV_CXXFLAGS            = -fno-exceptions -fno-rtti \
     1467        -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
     1468        -O2 -fno-format-extensions -fno-strict-aliasing -fno-common -finline-limit=8000 \
     1469        $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
     1470        -nostdinc
    14401471TEMPLATE_VBOXR0DRV_SYSSUFF             = .ko
    1441 TEMPLATE_VBOXR0DRV_LDFLAGS.x86         = -m elf_i386 -r
    1442 TEMPLATE_VBOXR0DRV_LDFLAGS.amd64       = -m elf_x86_64 -r
    1443 endif
     1472TEMPLATE_VBOXR0DRV_LDFLAGS             = -d --warn-common
     1473TEMPLATE_VBOXR0DRV_LDFLAGS.x86         = -m elf_i386_fbsd
     1474TEMPLATE_VBOXR0DRV_LDFLAGS.amd64       = -m elf_x86_64 "Port me to amd64 FreeBSD"
     1475
     1476TOOL_FREEBSDKMODLD = FreeBSD kernel module linker.
     1477# See kBuild/tools/GCC3.kmk for docs.
     1478TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld
     1479TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
     1480TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     1481TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPORD =
     1482define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
     1483        @# Link intermediate .kld (a relocatable object).
     1484        ld $(flags) -r -o $(outbase).kld $(objs) \
     1485                $(foreach p,$(libpath), -L$(p))\
     1486                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
     1487        @# Strip non-exported symbols private and localize the exported ones.
     1488        awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \
     1489                | xargs -J% objcopy % $(outbase).kld
     1490        @# Link the final .ko (a shared object).
     1491        ld $(flags) -Bshareable -o $(out) $(outbase).kld
     1492endef
     1493
     1494endif # FreeBSD
    14441495
    14451496ifdef VBOX_WITH_VBOXDRV
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette