[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



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:

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.

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.

Thanks,

Simon

Attachment: config-arm32
Description: Text document

_______________________________________________
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®.