HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • ← Previous Change
  • Wiki History
  • Next Change →

Changes between Version 35 and Version 36 of CommonProblems


Ignore:
Timestamp:
07/27/10 10:50:33 (5 years ago)
Author:
michaelvoliveira
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CommonProblems

    v35 v36  
    114114 AC_CHECK_LIB(nsl, inet_ntoa) 
    115115}}} 
     116 
     117= Common Porting Problems = 
     118 
     119This page serves to collect information about common problems encountered when porting applications/libraries to the Haiku/BeOS platform. The problems should be identified by the (compiler) errors that typify them. 
     120 
     121Information about BeOS's POSIX compatibility, see [wiki:BeOSPosix]. 
     122 
     123=== no undefined references allowed in i586-pc-beos shared libraries === 
     124 
     125ports: [wiki:dev-util/subversion], [wiki:dev-libs/apr] 
     126 
     127You need to pass the {{{-no-undefined}}} option to libtool 
     128 
     129Alternatively, libtool can be patched to always exhibit this behavior, at the risk of breaking static compilation when dynamic linking fails. -- andreasf 
     130 
     131=== (stat) structure has no member named `st_blocks' (Now fixed in Haiku) === 
     132 
     133ports: [wiki:app-arch/tar] (make check), [wiki:net-fs/samba], [wiki:dev-util/cvs] 
     134 
     135The stat struct in sys/stat.h in BeOS ~~and Haiku~~ ([http://dev.haiku-os.org/ticket/2261 Haiku now has it] [http://dev.haiku-os.org/changeset/27791 as seen here]) doesn't have an st_blocks member. In projects with autoconf, you can check for HAVE_STAT_ST_BLOCKS. 
     136 
     137http://lists.samba.org/archive/samba-technical/2005-January/039275.html 
     138 
     139=== -lm === 
     140 
     141ports: [wiki:dev-lang/lua], others 
     142 
     143The -lm refers to libm which isn't needed for Haiku or BeOS as the math library is part of libroot and linked by default 
     144 
     145Please DO NOT create a shortcut of libroot.so and rename to libm.so on gcc4 and gcc2 lib directory (Haiku hybrids case) or change the -lm references in the configure file to -lroot. 
     146If the port is using the autotools chances are this can be fixed by doing an AC_CHECK_LIB for cos in m and then setting a variable such as LIBM or MLIB to by ="-lm" if true or "" if not. 
     147 
     148Here is some explanation: 
     149http://www.freelists.org/archives/haiku-development/04-2008/msg00904.html 
     150 
     151=== -lc === 
     152 
     153This sometimes turns up, and I think it is due to the port using an older libtool.  Try running libtoolize --force --copy --install, aclocal, autoconf and automake before ./configure to see if that clears it up. 
     154 
     155=== conflicting types for `restrict' (Now fixed in Haiku) === 
     156 
     157/boot/develop/headers/posix/search.h:35: conflicting types for `restrict' 
     158/boot/develop/headers/posix/search.h:35: previous declaration of `restrict' 
     159This seems to be an issue with Haiku and has been reported [http://dev.haiku-os.org/ticket/2262 Haiku-2262] 
     160This has been fixed in Haiku.  If using a version  prior to the fix you can copy the search.h file over the one in your headers/posix folder. 
     161 
     162=== GCC 2.9 related build problems === 
     163 
     164output_operand_lossage `invalid expression as operand' 
     165 
     166This can be avoided by not passing the '-g' option to gcc for this test. 
     167 
     168 
     169=== GCC 4.3 related build problems === 
     170 
     171Typical errors look like these: 
     172 
     173error: 'find' is not a member of 'std' 
     174 
     175error: 'exit' was not declared in this scope 
     176 
     177Please take a look at: http://www.cyrius.com/journal/2007/05/10#gcc-4.3-include 
     178 
     179or 
     180 
     181http://www.comp.leeds.ac.uk/hannah/cpp/errors.html 
     182 
     183=== MSG_NOSIGNAL undeclared === 
     184 
     185Add below to header/source file. 
     186 
     187{{{ 
     188#ifndef MSG_NOSIGNAL  
     189#define MSG_NOSIGNAL 0  
     190#endif 
     191}}} 
     192 
     193=== O_NOATIME undeclared === 
     194 
     195Add below to header/source file. 
     196 
     197{{{ 
     198#include <fcntl.h> 
     199#ifndef _GNU_SOURCE 
     200#define _GNU_SOURCE // for O_NOATIME 
     201#define O_NOATIME 01000000 
     202#endif 
     203}}} 
     204 
     205 
     206=== DT_DIR undeclared === 
     207 
     208The use of DT_DIR doesn't work on non-ext* filesystems 
     209 
     210So replace for 
     211 
     212{{{ 
     213#ifndef DT_DIR 
     214/* dirent.d_type is a BSD extension, not part of POSIX */ 
     215#include <sys/stat.h> 
     216#include <string.h> 
     217 
     218static int 
     219is_dir (const char *path, const char *name) 
     220{ 
     221  int len1 = strlen(path); 
     222  int len2 = strlen(name); 
     223 
     224  char pathname[len1 + 1 + len2 + 1 + 13]; 
     225  strcpy (pathname, path); 
     226 
     227  /* Avoid UNC-path "//name" on Cygwin.  */ 
     228  if (len1 > 0 && pathname[len1 - 1] != '/') 
     229    strcat (pathname, "/"); 
     230 
     231  strcat (pathname, name); 
     232 
     233  struct stat st; 
     234  if (stat (pathname, &st)) 
     235    return 0; 
     236  return S_ISDIR (st.st_mode); 
     237} 
     238#endif 
     239}}} 
     240 
     241And after a check function 
     242 
     243{{{ 
     244info.dir = !! is_dir (path, de->d_name); 
     245}}} 
     246 
     247 
     248 

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/