#milkymist IRC log for Thursday, 2013-03-07

lekernelmwalle, do you have a contact to get my urjtag patch merged?18:11
Fallenouhum I have some troubles with lm32 GNU as when trying to compile NetBSD kernel22:10
FallenouI 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 constant22:13
Fallenouhere is more information about the issue: http://pastebin.com/qy3gPC7s22:13
Fallenouit seems my GNU as is having troubles with the ".size" gas operation22:13
Fallenouall the warnings are "debug" I added inside GNU as to try to understand what goes wrong22:14
Fallenouthe assembly generated by gcc seems correct : .size symbol_name, .-symbol_name22:15
Fallenouright after the end of the function22:15
Fallenouso it seems to be a GNU AS only issue22:15
wpwrak"Warning: This is the end!" such optimism ;-)22:20
Fallenouthe 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#L219722:21
Fallenouwpwrak: 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
Fallenouafter verification left != right22:22
Fallenouresolve_expression() is called by https://github.com/fallen/lm32-binutils-mmu/blob/master/gas/config/obj-elf.c#L189422:23
Fallenoucalled by elf_frob_symbol (what a strange name, I wonder what it means ...)22:23
Fallenouand you can see a few lines below my error message "does not evaluate to a constant"22:24
wpwrakmaybe there's something weird in the function ?22:24
Fallenouoh wait ...22:24
Fallenousize->X_op is not O_constant22:25
Fallenouit's O_subtract22:25
wpwrakmaybe try a code snippet from a (working) non-BSD build. then see if the .size works with the gas-for-BSD22:25
FallenouI wonder if resolve_expression() is called first ... (before the test of size->X_op == O_constant)22:26
wpwrakif it does, take the problem code, then reduce it until it passes22:26
wpwrak(reduce) first in C, then in assembler22:26
Fallenouyeah you're right22:28
wpwrakactually ... are those things even defined ?22:28
Fallenouif ( f(x) && x->something == a )  <=== is f() called before the test x->something == a ?22:28
FallenouI would say yes22:29
Hawk777Yes, because if f(x) returns false then the second expression is unevalutaed.22:29
Hawk777Short circuit && operator.22:29
Fallenouok, that's what I would have said22:29
Fallenouso size->X_op is not reduced by resolve_expression() to a constant, it stays a subtraction22:30
wpwrakin the .s you pastebinned, i see no definition of compat_offseterr22:30
Fallenouoh22:30
Fallenouindeed22:30
FallenouI have mistaken the .global for a definition22:30
Fallenoubut it's not ...22:30
wpwraksame for emul_find_root, etc.22:31
Fallenouok so it's GCC's fault :)22:31
Fallenougcc forgot to add "compat_offseterr: "22:31
wpwrakso it seems :)22:31
Fallenougreat ! thanks :)22:31
Action: Fallenou stops torturing GNU AS22:31
wpwrakor 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
Fallenouchaos22:40
FallenouASM_DECLARE_FUNCTION_NAME ...22:40
Fallenouok it misses some "ASM_OUTPUT_LABEL"22:44
Fallenouok thanks for the help I was starting to lose my mind ^^22:48
Fallenougn8 !22:48
wpwraksane dreams ! ;-)22:53
--- Fri Mar 8 201300:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!