[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH VTPM fix] Fix compilation bug with cmake



On Thu, 2013-01-17 at 09:47 +0000, Ian Campbell wrote:
> On Wed, 2013-01-16 at 19:09 +0000, Matthew Fioravante wrote:
> > On 01/16/2013 02:05 PM, Matthew Fioravante wrote:
> > > Some older versions of cmake don't pass compiler
> > > flags correctly when -DCMAKE_C_FLAGS and
> > > -DCMAKE_C_COMPILER are both specified. This
> > > behavior was observed on debian squeeze with
> > > cmake 2.8.2. This patch fixes the bug by
> > > using CC=${CC} cmake .. instead of
> > > -DCMAKE_C_COMPILER.
> > Ian, can you test this patch on your system and see if make cross-tpmemu 
> > passes -DTPM_NO_EXTERN etc.. as it should?
> 
> I applied it to v9 and I'm afraid the result was:
>         ld -nostdlib 
> -L/local/scratch/ianc/devel/committer.git/stubdom/cross-root-x86_64/x86_64-xen-elf/lib
>   -m elf_x86_64 -T arch/x86/minios-x86_64.lds 
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o 
>  -o 
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os
>         ld: warning: section `.bss' type changed to PROGBITS
>         
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o:
>  In function `mkdirs':
>         tpm_emulator_extern.c:(.text+0xbd95): undefined reference to 
> `__errno_location'
>         tpm_emulator_extern.c:(.text+0xbdad): undefined reference to 
> `__errno_location'
>         
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o:
>  In function `_tpm_extern_init':
>         tpm_emulator_extern.c:(.text+0xbe7f): undefined reference to `open'
>         tpm_emulator_extern.c:(.text+0xbe9b): undefined reference to 
> `__errno_location'
>         
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o:
>  In function `_tpm_write_to_storage':
>         tpm_emulator_extern.c:(.text+0xc1e9): undefined reference to `open'
>         
> /local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os.o:
>  In function `_tpm_read_from_storage':
>         tpm_emulator_extern.c:(.text+0xc27b): undefined reference to `open'
>         tpm_emulator_extern.c:(.text+0xc2a2): undefined reference to `lseek'
>         tpm_emulator_extern.c:(.text+0xc2ba): undefined reference to `lseek'
>         make[1]: *** 
> [/local/scratch/ianc/devel/committer.git/stubdom/mini-os-x86_64-vtpm/mini-os] 
> Error 1
>         make[1]: Leaving directory 
> `/local/scratch/ianc/devel/committer.git/extras/mini-os'
>         make: *** [vtpm-stubdom] Error 2
>         make: Leaving directory 
> `/local/scratch/ianc/devel/committer.git/stubdom'

These references are from the same file as before and my logs show:

[ 31%] Building C object tpm/CMakeFiles/tpm.dir/tpm_emulator_extern.o
        cd 
/local/scratch/ianc/devel/committer.git/stubdom/tpm_emulator-x86_64/build/tpm
         && /usr/lib/ccache/gcc   -I/opt/local/include
        -I/local/scratch/ianc/devel/committer.git/stubdom/tpm_emulator-x86_64
        
-I/local/scratch/ianc/devel/committer.git/stubdom/tpm_emulator-x86_64/build  
         -Wall -Werror -Wno-unused-parameter -Wpointer-arith
        -Wcast-align
         -Wwrite-strings -Wextra -o
         CMakeFiles/tpm.dir/tpm_emulator_extern.o  
        -c 
/local/scratch/ianc/devel/committer.git/stubdom/tpm_emulator-x86_64/tpm/tpm_emulator_extern.c

IOW no -DTPM_NO_EXTERN.

The only use of TPM_NO_EXTERN in my logs is in the invocation of cmake:

        cd tpm_emulator-x86_64/build; CC=gcc /usr/bin/cmake .. 
        -DCMAKE_C_FLAGS="-std=c99 -DTPM_NO_EXTERN
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include
        -D__MINIOS__ -DHAVE_LIBC
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../tools/xenstore 
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/x86/x86_64
        -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/../extras/mini-os/include/posix
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/cross-root-x86_64/x86_64-xen-elf/include
        -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.5/include
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include
        -isystem 
/local/scratch/ianc/devel/committer.git/stubdom/lwip-x86_64/src/include/ipv4
        -I/local/scratch/ianc/devel/committer.git/stubdom/include
        -I/local/scratch/ianc/devel/committer.git/stubdom/../xen/include
        -mno-red-zone -O1 -fno-omit-frame-pointer  -m64 -mno-red-zone
        -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g
        -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes
        -Wdeclaration-after-statement   -fno-stack-protector
        -fno-exceptions
        -Wno-declaration-after-statement"

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.