#3021 closed defect (wontfix)

libbsd cannot compile with -O0 option

Reported by: phongvanpham Owned by:
Priority: normal Milestone:
Component: network/libbsd Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Currently the symbol swi_remove is #ifdef'ed out in rtems (kern_intr.c). However, there are places that were referencing swi_remove without #ifdef around it. I am new to libbsd and I currently do not have expertise to determine if the actual swi test itself needs to be removed or just ifdef'ed out where swi_remove symbol is referenced or anything in between. Attached is a screenshot showing swi_remove is referenced.

One last note, compiling with -O2 is ok.

Attachments (1)

swi_remove_symbol_missing.PNG (73.5 KB) - added by phongvanpham on May 18, 2017 at 5:28:15 PM.

Download all attachments as: .zip

Change History (6)

Changed on May 18, 2017 at 5:28:15 PM by phongvanpham

comment:1 Changed on May 19, 2017 at 7:35:31 AM by Sebastian Huber

Which BSP did you use? I use -O0 sometimes and it works well.

comment:2 in reply to:  1 Changed on May 22, 2017 at 4:41:30 PM by phongvanpham

Replying to Sebastian Huber:

Which BSP did you use? I use -O0 sometimes and it works well.

The issue has to do with a lack of the following additional compiler (and linker) options

-ffunction-sections
-fdata-sections
-Wl,--gc-sections

when compiling with -O0.

Since some of compiler+linker options are partially taken from BSP settings, are you mandating that the above options to be in the BSP in order to use libbsd?

Personally, I don't think it is a good idea. If you need them to compile libbsd, you should explicitly state them in the waf compiling environment (assuming you don't want to fix the swi_remove symbol issue directly) by modifying the libbsd_waf.py (or wherever the input to the tool that autogenerate libbsd_waf.py). In this way, you're removing the dependency from BSP compiling options.

comment:3 Changed on May 23, 2017 at 5:57:30 AM by Sebastian Huber

Every BSP should use these options. Yes, its not obvious and setting these options explicitly in every BSP is bad.

comment:4 in reply to:  3 Changed on May 23, 2017 at 4:41:35 PM by phongvanpham

Replying to Sebastian Huber:

Every BSP should use these options. Yes, its not obvious and setting these options explicitly in every BSP is bad.

From your comment, I couldn't figure out what your plan of action is.

If it is a mandate that every BSP is required to have those compiler/linker options in order to use rtems-libbsd, then this ticket is no longer valid and pls. feel free to close it as "wont fix".

From my end, there is nothing else to do for this ticket.

comment:5 Changed on May 24, 2017 at 5:16:37 AM by Sebastian Huber

Resolution: wontfix
Status: newclosed

There are some tickets to enable these options on every BSP.

Note: See TracTickets for help on using tickets.