[vbox-dev] Remove a hack in bsd which disable -O2 in VBoxSVC

Howard Su howard0su at gmail.com
Tue Mar 29 19:54:09 PDT 2011


thanks.

On Wed, Mar 30, 2011 at 1:42 AM, Klaus Espenlaub <klaus.espenlaub at oracle.com
> wrote:

> sorry about the late reply... something resembling your patches is now
> integrated in VirtualBox (trunk only so far). The change should show up
> tomorrow or so. Used a slightly different approach, but the results should
> be the same.
>
> Klaus
>
>
> On 14.02.2011 02:42, Howard Su wrote:
>
>> Latest version of patch, tested in FreeBSD 8.1
>>
>>
>> Index: VBox/Main/src-server/xpcom/server.cpp
>> ===================================================================
>> --- VBox/Main/src-server/xpcom/server.cpp       (revision 35941)
>> +++ VBox/Main/src-server/xpcom/server.cpp       (working copy)
>> @@ -662,23 +662,7 @@
>>
>>
>>  ////////////////////////////////////////////////////////////////////////////////
>>
>> -static const nsModuleComponentInfoEx components[] =
>> -{
>> -    nsModuleComponentInfoEx(
>> -        "VirtualBox component",
>> -        CLSID_VirtualBox,
>> -        NS_VIRTUALBOX_CONTRACTID,
>> -        VirtualBoxConstructor, // constructor function
>> -        NULL, // registration function
>> -        NULL, // deregistration function
>> -        VirtualBoxClassFactory::FactoryDestructor, // factory
>> destructor function
>> -        NS_CI_INTERFACE_GETTER_NAME(VirtualBox),
>> -        NULL, // language helper
>> -&NS_CLASSINFO_NAME(VirtualBox),
>> -        0, // flags
>> -        VirtualBoxClassFactory::FactoryConstructor // factory
>> constructor function
>> -    )
>> -};
>> +static const nsModuleComponentInfoEx *components;
>>
>>
>>  /////////////////////////////////////////////////////////////////////////////
>>
>> @@ -941,8 +925,24 @@
>>          }
>>
>>          registrar->AutoRegister(nsnull);
>> -        rc = RegisterSelfComponents(registrar, components,
>> -                                    NS_ARRAY_LENGTH (components));
>> +
>> +       components = new nsModuleComponentInfoEx(
>> +        "VirtualBox component",
>> +        CLSID_VirtualBox,
>> +        NS_VIRTUALBOX_CONTRACTID,
>> +        VirtualBoxConstructor, // constructor function
>> +        NULL, // registration function
>> +        NULL, // deregistration function
>> +        VirtualBoxClassFactory::FactoryDestructor, // factory
>> destructor function
>> +        NS_CI_INTERFACE_GETTER_NAME(VirtualBox),
>> +        NULL, // language helper
>> +&NS_CLASSINFO_NAME(VirtualBox),
>> +        0, // flags
>> +               VirtualBoxClassFactory::FactoryConstructor // factory
>> constructor function
>> +       );
>> +
>> +       rc = RegisterSelfComponents(registrar, components,
>> +                                    1);
>>          if (NS_FAILED(rc))
>>          {
>>              RTMsgError("Failed to register server components!
>> (rc=%Rhrc)", rc);
>> @@ -1098,5 +1098,7 @@
>>      if (g_pszPidFile)
>>          RTFileDelete(g_pszPidFile);
>>
>> +    delete components;
>> +
>>      return 0;
>>  }
>> Index: VBox/Main/Makefile.kmk
>> ===================================================================
>> --- VBox/Main/Makefile.kmk      (revision 35941)
>> +++ VBox/Main/Makefile.kmk      (working copy)
>> @@ -244,10 +244,6 @@
>>  VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
>>
>>  VBoxSVC_CXXFLAGS = $(filter-out
>> -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
>> -## @todo We're disabling optimizations on FreeBSD to work around strange
>> linker
>> -#        errors in release builds. Figure out why and how to work
>> around it in a
>> -#        more optimal fashion.
>> -VBoxSVC_CXXFLAGS.freebsd = -O0
>>
>>  VBoxSVC_INCS = \
>>         include \
>>
>>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev
>



-- 
-Howard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20110330/6fbb9316/attachment-0001.html 


More information about the vbox-dev mailing list