Need help reducing gcc compiler warnings in BSD

Matthew Dillon dillon at backplane.com
Sat Jul 11 23:50:09 PDT 2015


On gcc-4.9 and other gcc related bloat in the boot code, you need to
experiment with the optimization options.  Some optimizations can make code
smaller, some can make it bigger.  Sometimes by a lot.  We've hit the boot2
limit ourselves a few times though not in a long while so I don't remember
the precise changes that were made.

One thing that can be helpful is to use objdump -d on boot2.out (somewhere
in /usr/obj when you build the boot code), comparing the output before and
after to track down where the size changes are centered.  boot2 is
relatively small code so a side-by-side comparison in two xterms is
doable.  diff won't work well in this case.

-Matt

On Sat, Jul 11, 2015 at 11:44 PM, Matthew Dillon <dillon at backplane.com>
wrote:

> Well, the boot code is a bit of a crap-shoot, because a lot of it is
> related to working around bugs in various BIOSes rather than actual bug
> fixes in the boot code itself.   Changes can sometimes break one platform
> while fixing another.  So wholesale copying of boot work in either
> direction without a huge amount of testing will meet with a great deal of
> resistance.
>
> -Matt
>
> On Sat, Jul 11, 2015 at 7:29 PM, Craig Rodrigues <rodrigc at freebsd.org>
> wrote:
>
>> Hi,
>>
>> Yes, I agree that formal collaboration is overkill for this stuff, but I
>> thought I would inform
>> the DragonFlyBSD community, because I have been benefiting by taking good
>> fixes
>> done to the DragonFlyBSD tree.  One advantage of the Jenkins build is
>> that it enumerates
>> the compiler warnings in a table, so it is easy to track over time if
>> compiler warnings increase or decrease
>> as code changes are made, so DragonFlyBSD users can monitor that if they
>> wish.
>>
>> One item I could use help with is that gcc 4.9 compiles FreeBSD's
>> i386/boot2 to
>> greater than 8192 bytes, so it is unusable:
>> https://lists.freebsd.org/pipermail/freebsd-testing/2015-March/000887.html
>>
>> I see that DragonFlyBSD has changed a lot of the boot code compared to
>> FreeBSD.
>> I'm not familiar with all the changes.  Are there fixes done in this area
>> for DragonFlyBSD
>> that could be pushed back to FreeBSD?
>>
>> --
>> Craig
>>
>> On Fri, Jul 10, 2015 at 3:56 PM, Matthew Dillon <dillon at backplane.com>
>> wrote:
>>
>>> I'm not sure the work load is high enough to require a formal
>>> collaboration.  We just fix things as they come up for the most part.
>>> Sascha has been doing WARNS related cleanups on the codebase and slowly
>>> bumping up the WARNS level for various parts of the build for years, which
>>> reduces problems going forwards.  It's mostly a matter of being proactive
>>> about it.
>>>
>>> -Matt
>>>
>>>
>>> On Fri, Jul 10, 2015 at 7:52 AM, Craig Rodrigues <rodrigc at freebsd.org>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I set up this Jenkins job which builds FreeBSD with gcc 4.9, and reports
>>>> all the compiler warnings here:
>>>>
>>>>
>>>> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/177/warnings17Result/
>>>>
>>>> I have been working with other people like Marcelo Araujo to
>>>> reduce the gcc compiler warnings on FreeBSD, even though
>>>> the default system compiler for FreeBSD is clang.
>>>> I have noticed that a lot of fixes to the problems have been down
>>>> in DragonFlyBSD.  I have imported some of these fixes, especially ones
>>>> done by
>>>> Sascha Wildner, such as this one:
>>>>
>>>> https://lists.freebsd.org/pipermail/svn-src-head/2015-May/072562.html
>>>>
>>>> Is there a way that we can collaborate across the FreeBSD and
>>>> DragonFlyBSD
>>>> projects to reduce gcc compiler warnings?  That it would be quite nice.
>>>> It would make code easier to share, and improve the code overall.
>>>>
>>>> Thanks.
>>>> --
>>>> Craig
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20150711/d4095eb0/attachment-0002.html>


More information about the Users mailing list