aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2]

Author Topic: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12  (Read 12334 times)

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #15 on: September 28, 2008, 09:43:16 PM »

Ok, the first snippet has been committed to SVN.

Now, I again ask you to test some code (also provided as an attachment):
Code: (sun-test.patch) [Select]
Index: ServerList.cpp
===================================================================
--- ServerList.cpp      (revision 9142)
+++ ServerList.cpp      (working copy)
@@ -916,7 +916,9 @@
 {
        std::vector<const CServer*> result;
        result.reserve(m_servers.size());
-       result.assign(m_servers.begin(), m_servers.end());
+       for (CInternalList::const_iterator it = m_servers.begin(); it != m_servers.end(); ++it) {
+               result.push_back(*it);
+       }
        return result;
 }
 
This does basically the same your patch did but without assuming that iterators are pointers. For your tests you may change const_iterator to iterator, and result.push_back(*it); to result.insert(result.end(), *it); Please post the results of the test.


P.S.: The removal of const from std::map key types is the opposite of what they suggest at http://docs.sun.com/source/820-4155/c++_faq.html#LibComp2
Logged
concordia cum veritate

Alfred

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #16 on: September 29, 2008, 09:24:24 AM »

GonoszTopi, tried the patch on my box here, it works fine. However, if I change const_iterator to iterator, I'll get the error below:
"ServerList.cpp", line 924: Error: Cannot use std::list<CServer*>::const_iterator to initialize std::list<CServer*>::iterator.
"ServerList.cpp", line 924: Error: The operation "std::list<CServer*>::iterator != std::list<CServer*>::const_iterator" is illegal.

And both result.push_back(*it); and result.insert(result.end(), *it); works with Sun Studio 12 here.

Attach is the patch.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #17 on: September 29, 2008, 04:50:07 PM »

I'm not sure we want to muddy the sourcecode because of one incomplete STL implementation in one specific IDE in a very rarely used platform.
Logged

Alfred

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #18 on: September 30, 2008, 09:24:42 AM »

Kry, I know it's possible to build aMule on Solaris with GCC and it runs. But in my opinion, if we can make it build with Sun Studio, it'll be easier to get it accepted by the OpenSolaris community.

I'm not quite sure about aMule's target audiences. What I know is that OpenSolaris is a potential choice for open source users. Even though it's not as popular as Linux distributions now. I guess that there must be some guide-line for aMule's patch acceptance. Something like to make the code even more cross-platform and avoid obscurity. So I personally hope that the change will follow the line and could still provide certain supports for a range of desktop users.

Anyway, thanks for the help I got from here.
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #19 on: September 30, 2008, 10:08:09 AM »

As long as we're replacing problematic passages with equally readable code which doesn't impact performance for other platforms, I see no reason not to make these changes.

Thank you for your efforts, Alfred, I appreciate them. Thanks to another motivated user, we've recently gained IRIX support - we need people like you to support less popular platforms.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #20 on: September 30, 2008, 05:01:51 PM »

Good cop, bad cop.
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #21 on: September 30, 2008, 05:32:29 PM »

As I understand the situation, we currently support the Sun Studio 12 compiler, but we don't support its default STL implementation, libCstd. However, the compiler can be told to use a full STL implementation, STLport.

Therefore I suggest the following:
1. Use the -library=stlport4 compiler switch to compile aMule. You need to compile the dependant C++ libraries with this switch too, i.e. wxWidgets and Crypto++
2. Encourage OpenSolaris developers to make STLport the default STL implementation.
3. In the wiki provide a full patch (or a link to this forum topic) to compile with libCstd, for those that want to.
Logged
concordia cum veritate

Alfred

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #22 on: October 07, 2008, 06:14:00 PM »

GonoszTopi, a good news about Sun Studio's C++ support is that: ARC case PSARC 2008/549 (http://opensolaris.org/os/community/arc/caselog/2008/549/) has been filed to make Apache libstdcxx the required C++ runtime library for Solaris components. Unlike libCstd and STLport, it fully conforms to the C++ standard. Hopefully, this could replace the old libCstd in Solaris soon.

As for now, I'm fine to keep the patch specifically for Solaris. Anyway, thanks for the help, guys!
Logged

Alfred

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: Fail to run aMule 2.2.2 on Solaris x86 after building with Sun Studio 12
« Reply #23 on: December 30, 2008, 09:43:21 AM »

guys, just want to give some update for aMule on Solaris built with Sun Studio 12. The spec file to build aMule 2.2.2 is ready here: https://pkgbuild.svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk/SFEamule.spec, and the patch: https://pkgbuild.svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk/patches/amule-01-sun-studio12.patch. I'll try to bump it to 2.2.3 later.

As I mentioned in the previous post, the Apache C++ standard library will be integrated soon. All the C++ applications/libraries in OpenSolaris will change to link against it for better C++ STL support.

One problem with the current binary is that when a download finishes, it crashes with the core stack below:
 fe303d3d mutex_unlock_queue (92b6288, 0, 8042efc, fe30505a) + 4d
 fe305177 mutex_unlock (92b6288, 9601238, 8042f34, fdc2be82) + 12b
 fdc2bed0 g_atomic_int_get (9312884, 50, 939e438, fdd15b42) + 5c
 fdd15b7b g_object_unref (9312880, 1, 8042f8c, 0) + 47
 fe080cf5 gtk_widget_style_get_valist (9312880, fe16588c, 8043014, fe080d50) + 2ad
 fe080d75 gtk_widget_style_get (9312880, fe16588c, 8043028, 0) + 3d
 fdec87ea gtk_button_get_props (9312880, 804308c, 0, 804309c, 0, 0) + 10e
 fdec899e gtk_button_size_allocate (9312880, 804348c, 933a428, fdd2740a) + 46
 fdd27461 g_cclosure_marshal_VOID__BOXED (93a7268, 0, 2, 970b8a0, 8043284, fdec8958) + 65
 fdd0f6c6 g_type_class_meta_marshal (93a7268, 0, 2, 970b8a0, 8043284, 80) + 46
 fdd0f3b1 g_closure_invoke (93a7268, 0, 2, 970b8a0, 8043284, 96073e8) + b1
 fdd25434 signal_emit_unlocked_R (9332838, 0, 9312880, 0, 970b8a0, 9312880) + 8e8
 fdd2473c g_signal_emit_valist (9312880, 10, 0, 8043478) + 9c8
 fdd2493d g_signal_emit (9312880, 10, 0, 804348c) + 25
 fe07923e gtk_widget_size_allocate (9312880, 80434dc, 8043504, fe759b23) + 1da
 fe759b7d gtk_pizza_allocate_child (93b4e68, 9604030, 8043544, fe759507) + a9
 fe7595ef gtk_pizza_size_allocate (93b4e68, 80438fc, 933a428, fdd2740a) + 1a3
 fdd27461 g_cclosure_marshal_VOID__BOXED (93a7268, 0, 2, 970b6c8, 80436f4, fe75944c) + 65
 fdd0f6c6 g_type_class_meta_marshal (93a7268, 0, 2, 970b6c8, 80436f4, 80) + 46
 fdd0f3b1 g_closure_invoke (93a7268, 0, 2, 970b6c8, 80436f4, 1) + b1
 fdd25434 signal_emit_unlocked_R (9332838, 0, 93b4e68, 0, 970b6c8, 93b4e68) + 8e8
 fdd2473c g_signal_emit_valist (93b4e68, 10, 0, 80438e8) + 9c8
 fdd2493d g_signal_emit (93b4e68, 10, 0, 80438fc) + 25
 fe07923e gtk_widget_size_allocate (93b4e68, 804397c, 80439a4, fdfc3afe) + 1da
 fdfc3bd1 gtk_scrolled_window_size_allocate (930f410, 8043d5c, 933a428, fdd2740a) + 141
 fdd27461 g_cclosure_marshal_VOID__BOXED (93a7268, 0, 2, 96bd3b8, 8043b54, fdfc3a90) + 65
 fdd0f6c6 g_type_class_meta_marshal (93a7268, 0, 2, 96bd3b8, 8043b54, 80) + 46
......

Will try to build aMule and all the dependent libraries with Apache C++ library to see whether the problem is fixed.
Logged
Pages: 1 [2]