| lekernel | mwalle, do you have a contact to get my urjtag patch merged? | 18:11 |
|---|---|---|
| Fallenou | hum I have some troubles with lm32 GNU as when trying to compile NetBSD kernel | 22:10 |
| Fallenou | I get this error message from GNU as (called by GCC): /var/folders/ab/abyj3M5qFtefd2hEj876WU+++TI/-Tmp-//ccjcEt9q.s: Error: .size expression for compat_offseterr does not evaluate to a constant | 22:13 |
| Fallenou | here is more information about the issue: http://pastebin.com/qy3gPC7s | 22:13 |
| Fallenou | it seems my GNU as is having troubles with the ".size" gas operation | 22:13 |
| Fallenou | all the warnings are "debug" I added inside GNU as to try to understand what goes wrong | 22:14 |
| Fallenou | the assembly generated by gcc seems correct : .size symbol_name, .-symbol_name | 22:15 |
| Fallenou | right after the end of the function | 22:15 |
| Fallenou | so it seems to be a GNU AS only issue | 22:15 |
| wpwrak | "Warning: This is the end!" such optimism ;-) | 22:20 |
| Fallenou | the resolve_expression() of GAS seems to return 0 over there , leading to the Error : https://github.com/fallen/lm32-binutils-mmu/blob/master/gas/expr.c#L2197 | 22:21 |
| Fallenou | wpwrak: actually those messages mean that some of resolve_expression() call make it to the end of the function , to the return 1 meaning "all is ok" :) | 22:22 |
| Fallenou | after verification left != right | 22:22 |
| Fallenou | resolve_expression() is called by https://github.com/fallen/lm32-binutils-mmu/blob/master/gas/config/obj-elf.c#L1894 | 22:23 |
| Fallenou | called by elf_frob_symbol (what a strange name, I wonder what it means ...) | 22:23 |
| Fallenou | and you can see a few lines below my error message "does not evaluate to a constant" | 22:24 |
| wpwrak | maybe there's something weird in the function ? | 22:24 |
| Fallenou | oh wait ... | 22:24 |
| Fallenou | size->X_op is not O_constant | 22:25 |
| Fallenou | it's O_subtract | 22:25 |
| wpwrak | maybe try a code snippet from a (working) non-BSD build. then see if the .size works with the gas-for-BSD | 22:25 |
| Fallenou | I wonder if resolve_expression() is called first ... (before the test of size->X_op == O_constant) | 22:26 |
| wpwrak | if it does, take the problem code, then reduce it until it passes | 22:26 |
| wpwrak | (reduce) first in C, then in assembler | 22:26 |
| Fallenou | yeah you're right | 22:28 |
| wpwrak | actually ... are those things even defined ? | 22:28 |
| Fallenou | if ( f(x) && x->something == a ) <=== is f() called before the test x->something == a ? | 22:28 |
| Fallenou | I would say yes | 22:29 |
| Hawk777 | Yes, because if f(x) returns false then the second expression is unevalutaed. | 22:29 |
| Hawk777 | Short circuit && operator. | 22:29 |
| Fallenou | ok, that's what I would have said | 22:29 |
| Fallenou | so size->X_op is not reduced by resolve_expression() to a constant, it stays a subtraction | 22:30 |
| wpwrak | in the .s you pastebinned, i see no definition of compat_offseterr | 22:30 |
| Fallenou | oh | 22:30 |
| Fallenou | indeed | 22:30 |
| Fallenou | I have mistaken the .global for a definition | 22:30 |
| Fallenou | but it's not ... | 22:30 |
| wpwrak | same for emul_find_root, etc. | 22:31 |
| Fallenou | ok so it's GCC's fault :) | 22:31 |
| Fallenou | gcc forgot to add "compat_offseterr: " | 22:31 |
| wpwrak | so it seems :) | 22:31 |
| Fallenou | great ! thanks :) | 22:31 |
| Action: Fallenou stops torturing GNU AS | 22:31 | |
| wpwrak | or maybe it's one of the build options. -ffreestanding or -fno-common (i never used them) | 22:33 |
| Action: Fallenou trying to understand gcc internals ... defines everywhere ... | 22:40 | |
| Fallenou | chaos | 22:40 |
| Fallenou | ASM_DECLARE_FUNCTION_NAME ... | 22:40 |
| Fallenou | ok it misses some "ASM_OUTPUT_LABEL" | 22:44 |
| Fallenou | ok thanks for the help I was starting to lose my mind ^^ | 22:48 |
| Fallenou | gn8 ! | 22:48 |
| wpwrak | sane dreams ! ;-) | 22:53 |
| --- Fri Mar 8 2013 | 00:00 | |
Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!