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

Re: [Minios-devel] [UNIKRAFT PATCH v5 1/1] build: always produce 2 images: w/ and w/o debug syms



Hi,

Simon Kuenzer <simon.kuenzer@xxxxxxxxx> writes:

> Hey,
>
> On 31.05.19 12:53, Yuri Volchkov wrote:
>> Hi,
>> 
>> Simon Kuenzer <simon.kuenzer@xxxxxxxxx> writes:
>> 
>>> Hey Yuri,
>>>
>>> I applied your patch but faced still a couple of problems with the
>>> updated `Linker.uk` files. The Xen Arm32 build broke even. See my
>>> comments inline.
>> Arm32 is broken not because of this patch. Unless you really find
>> something new. Could you please check without the patch and compare
>> results?
>
> Please see below.
>
>> 
>>> The rest should be fine.
>>>
>>> Thanks a lot,
>>>
>>> Simon
>>>
>>> On 29.05.19 19:17, Yuri Volchkov wrote:
>>>>                         $(KVM_LD_SCRIPT_FLAGS) \
>>>> -               $@.o -o $@)
>>>> -ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y)
>>>> -  $(call build_cmd,OBJCOPY,,$@.dbg,\
>>>> -         $(OBJCOPY) --only-keep-debug $@ $@.dbg)
>>>> -endif
>>>> +               $@.o -o $@.dbg)
>>>> +  $(call verbose_cmd,SCSTRIP,$(notdir $@),\
>>>> +          $(SCRIPTS_DIR)/sect-strip.py \
>>>> +                  $(SECT_STRIP_FLAGS) $(SECT_STRIP_FLAGS-y) \
>>>> +                  --with-objcopy=$(OBJCOPY) \
>>>> +                  $@.dbg -o $@)
>>>> +  $(call verbose_cmd,STRIP,$(notdir $@), $(STRIP) $@)
>>>
>>> Running the strip command has to be called after the following `NM`
>>> call. Otherwise the `.sym` files are empty. Can you keep `-s` parameter
>>> as it was before?:
>>>     $(call verbose_cmd,STRIP,$(notdir $@),$(STRIP) -s $@)
>> 
>> Indeed it is a mistake. Good catch. I just need to run nm on *.dbg
>> image. And order actually does not matter.
>
> This is also fine, yes.
>
>> 
>> And you are right about -s option.
>>>
>>>>                         $(XEN_LD_SCRIPT_FLAGS) \
>>>> -               $@.o -o $@.elf)
>>>> -ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y)
>>>> -  $(call build_cmd,OBJCOPY,,$@.dbg,\
>>>> -         $(OBJCOPY) --only-keep-debug $@.elf $@.dbg)
>>>> -endif
>>>> +               $@.o -o $@.elf.dbg)
>>>> +  $(call verbose_cmd,SCSTRIP,$(notdir $@.elf),\
>>>> +          $(SCRIPTS_DIR)/sect-strip.py \
>>>> +                  $(SECT_STRIP_FLAGS) $(SECT_STRIP_FLAGS-y) \
>>>> +                  --with-objcopy=$(OBJCOPY) \
>>>> +                  $@.elf.dbg -o $@.elf)
>>>> +  $(call verbose_cmd,STRIP,$(notdir $@.elf), $(STRIP) -o $@.elf)
>>>
>>> The `-o` option is incorrect for the strip command. `strip` fails with
>>> invalid arguments; use `-s`. Same problem with the `.sym` file order.
>>>
>
> Without an input file, `-o` does not make sense. I got the usage output 
> and the command returns with an error. You also never set this parameter 
> somewhere else, just on the Xen for Arm32 platform. I can show you my 
> verbose output:
Ah, right. That is a legacy from the earlier version I missed. Sorry
about that.
>
>> arm-linux-gnueabihf-strip -o 
>> /root/workspace/unikraft/unikraft/build/unikraft_xen-arm.elf
>> Usage: arm-linux-gnueabihf-strip <option(s)> in-file(s)
>>  Removes symbols and sections from files
>>  The options are:
>>   -I --input-target=<bfdname>      Assume input file is in format <bfdname>
>>   -O --output-target=<bfdname>     Create an output file in format <bfdname>
>>   -F --target=<bfdname>            Set both input and output format to 
>> <bfdname>
>>   -p --preserve-dates              Copy modified/access timestamps to the 
>> output
>>   -D --enable-deterministic-archives
>>                                    Produce deterministic output when 
>> stripping archives (default)
>>   -U --disable-deterministic-archives
>>                                    Disable -D behavior
>>   -R --remove-section=<name>       Also remove section <name> from the output
>>      --remove-relocations <name>   Remove relocations from section <name>
>>   -s --strip-all                   Remove all symbol and relocation 
>> information
>>   -g -S -d --strip-debug           Remove all debugging symbols & sections
>>      --strip-dwo                   Remove all DWO sections
>>      --strip-unneeded              Remove all symbols not needed by 
>> relocations
>>      --only-keep-debug             Strip everything but the debug information
>>   -N --strip-symbol=<name>         Do not copy symbol <name>
>>   -K --keep-symbol=<name>          Do not strip symbol <name>
>>      --keep-file-symbols           Do not strip file symbol(s)
>>   -w --wildcard                    Permit wildcard in symbol comparison
>>   -x --discard-all                 Remove all non-global symbols
>>   -X --discard-locals              Remove any compiler-generated symbols
>>   -v --verbose                     List all object files modified
>>   -V --version                     Display this program's version number
>>   -h --help                        Display this output
>>      --info                        List object formats & architectures 
>> supported
>>   -o <file>                        Place stripped output into <file>
>> arm-linux-gnueabihf-strip: supported targets: elf32-littlearm elf32-bigarm 
>> elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
>> /root/workspace/unikraft/unikraft/plat/xen/Linker.uk:18: recipe for target 
>> '/root/workspace/unikraft/unikraft/build/unikraft_xen-arm' failed
>> make: *** [/root/workspace/unikraft/unikraft/build/unikraft_xen-arm] Error 1
>
> I attached my `.config` file for you. You can use it to test Arm32 
> builds. Yes, Arm32 is a bit fragile at the moment but you can build it 
> when 'Drop unused functions' is set and uksched is removed. 
> Nevertheless, Arm32 needs to be fixed, but at least I could see that 
> your patch add another problem to it.
> If I remove the `-o` parameter and/or replace it with `-s` on the strip 
> command, it works fine.
Sure thing, this patch should not bring any more problems.

>
>> I don't understand.
>> 
>>    $ strip --help
>>    Usage: strip <option(s)> in-file(s)
>>    Removes symbols and sections from files
>>    The options are:
>>        ...
>>    -s --strip-all                   Remove all symbol and relocation 
>> information
>>        ...
>>    -o <file>                        Place stripped output into <file>
>>    
>> The -o looks correct to me. And what does '-s' has to do with '-o'?
>> 
>
> I was mentioning the `-s` parameter because we used that one originally. 
> In the meantime, I am not sure if this was a wise idea. It could have 
> been the cause for the KVM/QEMU boot problem that we experienced in the 
> past. If you do not want to add `-s`, please double check that your 
> lines do not include two white spaces between `$(STRIP)` and `$@` 
> unnecessarily.
I am not sure what '-s' does exactly. But I can see no difference
between images after 'strip' and 'strip -s'. I will just add this option
back.
>
> Thanks,
>
> Simon
> #
> # Automatically generated file; DO NOT EDIT.
> # Unikraft/0.3.1~9bc52b70 Configuration
> #
>
> #
> # Architecture Selection
> #
> # CONFIG_ARCH_X86_64 is not set
> # CONFIG_ARCH_ARM_64 is not set
> CONFIG_ARCH_ARM_32=y
> CONFIG_MARCH_ARM32_CORTEXA7=y
> # CONFIG_MARCH_ARM32_A20NEON is not set
>
> #
> # Platform Configuration
> #
> CONFIG_PLAT_XEN=y
> CONFIG_XEN_HVMLITE=y
>
> #
> # Console Options
> #
> CONFIG_XEN_KERNEL_EMG_CONSOLE=y
> CONFIG_XEN_DEBUG_EMG_CONSOLE=y
> CONFIG_PLAT_LINUXU=y
> CONFIG_LINUXU_DEFAULT_HEAPMB=4
>
> #
> # Platform Interface Options
> #
> # CONFIG_UKPLAT_MEMRNAME is not set
> CONFIG_HZ=100
>
> #
> # Library Configuration
> #
> CONFIG_HAVE_BOOTENTRY=y
> # CONFIG_HAVE_LIBC is not set
> # CONFIG_HAVE_SCHED is not set
> # CONFIG_HAVE_NW_STACK is not set
> CONFIG_LIBUKBOOT=y
> CONFIG_LIBUKBOOT_BANNER=y
> CONFIG_LIBUKBOOT_MAXNBARGS=60
> CONFIG_LIBUKBOOT_INITALLOC=y
> CONFIG_LIBUKDEBUG=y
> CONFIG_LIBUKDEBUG_PRINTK=y
> # CONFIG_LIBUKDEBUG_PRINTK_INFO is not set
> # CONFIG_LIBUKDEBUG_PRINTK_WARN is not set
> CONFIG_LIBUKDEBUG_PRINTK_ERR=y
> # CONFIG_LIBUKDEBUG_PRINTK_CRIT is not set
> CONFIG_LIBUKDEBUG_PRINTD=y
> CONFIG_LIBUKDEBUG_NOREDIR=y
> # CONFIG_LIBUKDEBUG_REDIR_PRINTD is not set
> # CONFIG_LIBUKDEBUG_REDIR_PRINTK is not set
> CONFIG_LIBUKDEBUG_PRINT_TIME=y
> # CONFIG_LIBUKDEBUG_PRINT_STACK is not set
> CONFIG_LIBUKDEBUG_ENABLE_ASSERT=y
> CONFIG_LIBUKARGPARSE=y
> # CONFIG_UKUNISTD is not set
> # CONFIG_UKSYSINFO is not set
> # CONFIG_LIBUKTIMECONV is not set
> CONFIG_LIBNOLIBC=y
> CONFIG_LIBNOLIBC_UKDEBUG_ASSERT=y
> CONFIG_LIBUKALLOC=y
> CONFIG_LIBUKALLOC_IFPAGES=y
> # CONFIG_LIBUKALLOC_IFSTATS is not set
> CONFIG_LIBUKALLOCBBUDDY=y
> # CONFIG_LIBUKSCHED is not set
> CONFIG_LIBFDT=y
> # CONFIG_LIBVFSCORE is not set
> # CONFIG_LIBUKLOCK is not set
> # CONFIG_LIBUKMPI is not set
> # CONFIG_LIBUKSWRAND is not set
> # CONFIG_LIBUKBUS is not set
> # CONFIG_LIBUKSGLIST is not set
> # CONFIG_LIBUKNETDEV is not set
>
> #
> # Build Options
> #
> # CONFIG_OPTIMIZE_NONE is not set
> CONFIG_OPTIMIZE_PERF=y
> # CONFIG_OPTIMIZE_SIZE is not set
> CONFIG_OPTIMIZE_DEADELIM=y
> # CONFIG_OPTIMIZE_LTO is not set
> # CONFIG_DEBUG_SYMBOLS_LVL1 is not set
> # CONFIG_DEBUG_SYMBOLS_LVL2 is not set
> CONFIG_DEBUG_SYMBOLS_LVL3=y
> CONFIG_OPTIMIZE_SYMFILE=y
> # CONFIG_RECORD_BUILDTIME is not set
> CONFIG_CROSS_COMPILE=""
> CONFIG_UK_NAME="unikraft"

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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