[On second thought: the build should not be depending on
/usr/include/machine/* . And using installworld to
indirectly update /usr/include/machine/* did not fix
the problem by itself. I still had to also delete
/usr/obj/amd64_clang/amd64.amd64/usr/src/sys/* in
order for buildkernel to work.]

On 2017-Jul-2, at 1:51 AM, Mark Millard <markmi at dsl-only.net> wrote:

> [Turns out META_MODE did not update /usr/include/machine/* .]
> 
> On 2017-Jul-2, at 12:43 AM, Mark Millard <markmi at dsl-only.net> wrote:
> 
>> I attempted to jump from head -r320482 to -r320570 for amd64
>> but the kernel build fails with massive numbers of things like:
>> 
>> 
>> I'll note that, for example, aac_disk.o was rebuilt:
>> 
>> --- all_subdir_aac ---
>> Building 
>> /usr/obj/amd64_clang/amd64.amd64/usr/src/sys/GENERIC-NODBG/modules/usr/src/sys/modules/aac/aac_disk.o
>> 
>> before the below happened.
>> 
>> 
>> --- kernel.full ---
>> aac_disk.o: In function `aac_disk_dump':
>> /usr/src/sys/dev/aac/aac_disk.c:253: undefined reference to 
>> `bus_dmamap_create'
>> /usr/src/sys/dev/aac/aac_disk.c:301: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/aac/aac_disk.c:314: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/aac/aac_disk.c:317: undefined reference to 
>> `_bus_dmamap_unload'
>> adv_pci.o: In function `adv_pci_attach':
>> /usr/src/sys/dev/advansys/adv_pci.c:225: undefined reference to 
>> `bus_dmamem_alloc'
>> . . .
>> --- kernel.full ---
>> advansys.o: In function `adv_destroy_ccb_info':
>> /usr/src/sys/dev/advansys/advansys.c:596: undefined reference to 
>> `bus_dmamap_destroy'
>> advansys.o: In function `adv_free':
>> /usr/src/sys/dev/advansys/advansys.c:696: undefined reference to 
>> `_bus_dmamap_unload'
>> /usr/src/sys/dev/advansys/advansys.c:699: undefined reference to 
>> `bus_dmamem_free'
>> advansys.o: In function `adv_done':
>> /usr/src/sys/dev/advansys/advansys.c:1093: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/advansys/advansys.c:1094: undefined reference to 
>> `_bus_dmamap_unload'
>> advansys.o: In function `adv_attach':
>> /usr/src/sys/dev/advansys/advansys.c:1335: undefined reference to 
>> `bus_dmamem_alloc'
>> advansys.o: In function `adv_alloc_ccb_info':
>> /usr/src/sys/dev/advansys/advansys.c:580: undefined reference to 
>> `bus_dmamap_create'
>> advansys.o: In function `adv_execute_ccb':
>> /usr/src/sys/dev/advansys/advansys.c:532: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/advansys/advansys.c:545: undefined reference to 
>> `_bus_dmamap_unload'
>> /usr/src/sys/dev/advansys/advansys.c:556: undefined reference to 
>> `_bus_dmamap_unload'
>> . . . (huge amount omitted) . . .
>> --- kernel.full ---
>> if_vmx.o: In function `vmxnet3_alloc_txq_data':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1243: undefined reference to 
>> `bus_dmamap_create'
>> if_vmx.o: In function `vmxnet3_alloc_rxq_data':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1366: undefined reference to 
>> `bus_dmamap_create'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1376: undefined reference to 
>> `bus_dmamap_create'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1366: undefined reference to 
>> `bus_dmamap_create'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1376: undefined reference to 
>> `bus_dmamap_create'
>> if_vmx.o: In function `vmxnet3_free_rxq_data':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1412: undefined reference to 
>> `bus_dmamap_destroy'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1420: undefined reference to 
>> `bus_dmamap_destroy'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1412: undefined reference to 
>> `bus_dmamap_destroy'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1420: undefined reference to 
>> `bus_dmamap_destroy'
>> if_vmx.o: In function `vmxnet3_free_txq_data':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1276: undefined reference to 
>> `bus_dmamap_destroy'
>> if_vmx.o: In function `vmxnet3_txq_unload_mbuf':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2798: undefined reference to 
>> `_bus_dmamap_unload'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2798: undefined reference to 
>> `_bus_dmamap_unload'
>> if_vmx.o: In function `vmxnet3_dma_malloc':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:3871: undefined reference to 
>> `bus_dmamem_alloc'
>> if_vmx.o: In function `vmxnet3_dma_free':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:3900: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:3902: undefined reference to 
>> `_bus_dmamap_unload'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:3906: undefined reference to 
>> `bus_dmamem_free'
>> if_vmx.o: In function `vmxnet3_txstop':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2358: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2360: undefined reference to 
>> `_bus_dmamap_unload'
>> if_vmx.o: In function `vmxnet3_rxstop':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2388: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2390: undefined reference to 
>> `_bus_dmamap_unload'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2388: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:2390: undefined reference to 
>> `_bus_dmamap_unload'
>> if_vmx.o: In function `vmxnet3_newbuf':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1959: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1960: undefined reference to 
>> `_bus_dmamap_unload'
>> if_vmx.o: In function `vmxnet3_txq_eof':
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1866: undefined reference to 
>> `_bus_dmamap_sync'
>> /usr/src/sys/dev/vmware/vmxnet3/if_vmx.c:1868: undefined reference to 
>> `_bus_dmamap_unload'
>> isci.o: In function `isci_allocate_dma_buffer':
>> /usr/src/sys/dev/isci/isci.c:424: undefined reference to `bus_dmamem_alloc'
>> isci_io_request.o: In function `isci_io_request_complete':
> 
> 
> Looks like this is the result of
> 
> /usr/include/machine/* (such as bus_dma.h )
> 
> not having been updated appropriately by
> META_MODE to match:
> 
> /usr/src/sys/amd64/include/bus_dma.h
> 
> 
> # diff -u /usr/include/machine/bus_dma.h /usr/src/sys/amd64/include/bus_dma.h
> --- /usr/include/machine/bus_dma.h    2017-03-23 11:14:59.000000000 -0700
> +++ /usr/src/sys/amd64/include/bus_dma.h      2017-07-01 23:58:19.756701000 
> -0700
> @@ -23,12 +23,12 @@
>  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>  * SUCH DAMAGE.
>  *
> - * $FreeBSD: head/sys/amd64/include/bus_dma.h 148275 2005-07-22 04:03:25Z 
> obrien $
> + * $FreeBSD: head/sys/amd64/include/bus_dma.h 320528 2017-07-01 05:35:29Z 
> jah $
>  */
> 
> #ifndef _AMD64_BUS_DMA_H_
> #define _AMD64_BUS_DMA_H_
> 
> -#include <sys/bus_dma.h>
> +#include <x86/bus_dma.h> 
> 
> #endif /* _AMD64_BUS_DMA_H_ */
> 
> 
> # ls -lTt /usr/include/machine/
> total 417
> -r--r--r--  1 root  wheel   7509 Jun 14 00:43:43 2017 vmparam.h
> -r--r--r--  1 root  wheel   3390 Jun 14 00:43:43 2017 proc.h
> -r--r--r--  1 root  wheel   8687 May  3 02:46:12 2017 pcpu.h
> -r--r--r--  1 root  wheel   2661 May  3 02:46:12 2017 counter.h
> -r--r--r--  1 root  wheel  22692 May  3 02:46:12 2017 atomic.h
> -r--r--r--  1 root  wheel   2935 Apr 15 00:24:33 2017 db_machdep.h
> -r--r--r--  1 root  wheel    154 Mar 23 11:14:59 2017 _align.h
> -r--r--r--  1 root  wheel   1837 Mar 23 11:14:59 2017 _bus.h
> -r--r--r--  1 root  wheel    160 Mar 23 11:14:59 2017 _inttypes.h
> -r--r--r--  1 root  wheel    156 Mar 23 11:14:59 2017 _limits.h
> -r--r--r--  1 root  wheel    156 Mar 23 11:14:59 2017 _stdint.h
> -r--r--r--  1 root  wheel    154 Mar 23 11:14:59 2017 _types.h
> . . .

Updating /usr/include/machine/* and then buildkernel did
not update the likes of:

/usr/obj/amd64_clang/amd64.amd64/usr/src/sys/GENERIC-NODBG/modules/usr/src/sys/modules/aac/aac_disk.o

again so the problem stayed.

Then deleting /usr/obj/amd64_clang/amd64.amd64/usr/src/sys/* and
doing buildkernel finally did manage to build correctly.

Remember that the original buildkernel attempt did rebuild:

/usr/obj/amd64_clang/amd64.amd64/usr/src/sys/GENERIC-NODBG/modules/usr/src/sys/modules/aac/aac_disk.o

but the result was bad for linking it (as an example). It appears
that I needed both steps to get a good build:

A) Update /usr/include/machine/* . (I did a full installworld.)

B) Delete /usr/obj/amd64_clang/amd64.amd64/usr/src/sys/* .

[Note: I force the path to have amd64.amd64/ : it is not
a cross build.]

So there may be two problems:

A) An apparent need for /usr/include/machine/* to be up
   to date. (Unless installworld had other side-effects
   that contributed.)

B) Lack of rebuilding the likes of:

/usr/obj/amd64_clang/amd64.amd64/usr/src/sys/GENERIC-NODBG/modules/usr/src/sys/modules/aac/aac_disk.o

once (A) was dealt with. (But I deleted more than just the long
list if failing .o's in order to force rebuilds.)

===
Mark Millard
markmi at dsl-only.net


_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to