View unanswered posts | View active topics It is currently Fri Dec 15, 2017 1:18 pm



Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
 undefined reference to `access' using devkitPPC r29-1 
Author Message

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
Found the problem trying to compile libpng-1.6.28 (portlibs)

issue opened at
https://github.com/devkitPro/newlib/issues/4

Error compiling libpng-1.6.28 (portlibs)

Code:
Makefile generated with this script:

---cut here
#!/bin/bash

PATH=${DEVKITPPC}/bin:${PATH}
HOST=powerpc-eabi
PREFIX=${DEVKITPRO}/portlibs/ppc

#libpng
cd libpng*
CPPFLAGS=-I${PREFIX}/include LDFLAGS=-L${PREFIX}/lib ./configure
--prefix=${PREFIX} --host=${HOST} --disable-shared --enable-static
make && make install
cd ${home}

---cut here


This is the output:

Code:
$ make
make all-am
make[1]: Entering directory /c/Users/Nebiun/Downloads/WIIdev/portlibs_2017/libp ng-1.6.28' /bin/sh ./libtool --tag=CC --mode=link powerpc-eabi-gcc -g -O2 -L/c/devkitP ro/portlibs/ppc/lib -o pngcp contrib/tools/pngcp.o libpng16.la -lz -lm libtool: link: powerpc-eabi-gcc -g -O2 -o pngcp contrib/tools/pngcp.o -L/c/devk itPro/portlibs/ppc/lib ./.libs/libpng16.a -lz -lm c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/6.3.0/../../../../powerpc-eab i/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 018000b8 contrib/tools/pngcp.o: In functionisdir':
c:\Users\Nebiun\Downloads\WIIdev\portlibs_2017\libpng-1.6.28/contrib/tools/pngcp
.c:1610: undefined reference to access' contrib/tools/pngcp.o: In functioncp_one_file':
c:\Users\Nebiun\Downloads\WIIdev\portlibs_2017\libpng-1.6.28/contrib/tools/pngcp
.c:2176: undefined reference to access' c:\Users\Nebiun\Downloads\WIIdev\portlibs_2017\libpng-1.6.28/contrib/tools/pngcp .c:2207: undefined reference toaccess'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [pngcp] Error 1
make[1]: Leaving directory `/c/Users/Nebiun/Downloads/WIIdev/portlibs_2017/libpn
g-1.6.28'
make: *** [all] Error 2


Fri Mar 24, 2017 6:11 pm
Profile

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
Same problem with devkitPPC r28


Sat Mar 25, 2017 3:59 pm
Profile

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
And in devkitPPC r27. :shock:

access prototype and defines needed for call the function are present in

devkitPPC/powerpc-eabi/include/sys/unistd.h

but the function is not in the library


Sat Mar 25, 2017 4:49 pm
Profile

Joined: Mon Jul 04, 2011 1:03 pm
Posts: 34
You can use this function to replace the "acccess function":

Code:
 
static int wii_access (const char *pathname, int mode)
{
   struct stat st;

   if (stat(pathname, &st) < 0)
      return -1;
      
   return 0; //With Wii the file/dir is considered always accessible if it exists
}
#define access wii_access


Sat Apr 01, 2017 12:00 pm
Profile

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
Oibaf wrote:
You can use this function to replace the "acccess function":

Code:
 
static int wii_access (const char *pathname, int mode)
{
   struct stat st;

   if (stat(pathname, &st) < 0)
      return -1;
      
   return 0; //With Wii the file/dir is considered always accessible if it exists
}
#define access wii_access


Problem is not emulate the function. Problem is add it to the standard library to avoid the need to add it to all packages that require access


Sat Apr 01, 2017 3:06 pm
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1210
Location: UK
The access error is coming from attempting to build tools for the host platform which makes no sense for our use case. The simplest way to get latest libpng built for devkitARM or devkitPPC is to patch out the tool binaries & tests which require this function. I would probably do this anyway even if the link error was fixed since the binaries serve no purpose with a bare metal toolchain.

You can grab a patched libpng 1.6.28 from https://sourceforge.net/projects/devkit ... tlibs/src/

_________________
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog


Mon Apr 03, 2017 3:52 pm
Profile ICQ WWW

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
WinterMute wrote:
The access error is coming from attempting to build tools for the host platform which makes no sense for our use case. The simplest way to get latest libpng built for devkitARM or devkitPPC is to patch out the tool binaries & tests which require this function. I would probably do this anyway even if the link error was fixed since the binaries serve no purpose with a bare metal toolchain.

You can grab a patched libpng 1.6.28 from https://sourceforge.net/projects/devkit ... tlibs/src/


:?
I don't know where is the problem to add "access" to newlib, when with a very little work we can have a working version of it.
"access" is a unix and linux syscall and it is used in many source. The needed defines and the prototype are already in devkitPPC/powerpc-eabi/include/sys/unistd.h.
Really is best modify the sources every time you update a portlibs?
If a library does not work, I must modify the original source, but if the problem is a missing routine that I can simply wrap, then I prefer wrap it and leave the original source untouched.


Mon Apr 03, 2017 6:05 pm
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1210
Location: UK
The problem here isn't that the library won't compile but that the associated tools and tests won't compile. These tools and tests are useless for bare metal so these have been patched out of the build process.

Even if they compiled they would still serve no purpose for a bare metal cross compiler - you can't run them. If you need the tools then they need compiled for the system you're compiling on NOT the system you're compiling for.

_________________
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog


Mon Apr 03, 2017 8:29 pm
Profile ICQ WWW

Joined: Sat Dec 28, 2013 2:42 pm
Posts: 22
WinterMute wrote:
The problem here isn't that the library won't compile but that the associated tools and tests won't compile. These tools and tests are useless for bare metal so these have been patched out of the build process.

Even if they compiled they would still serve no purpose for a bare metal cross compiler - you can't run them. If you need the tools then they need compiled for the system you're compiling on NOT the system you're compiling for.


The problem is not related to the compilation of libpng or a test process or a particular source.
I think that newlib library should have the "access" routine inside, because it is present in the standard u*x library (POSIX.1-2001).


Tue Apr 04, 2017 9:37 am
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1210
Location: UK
But you reported that libpng wouldn't compile showing an error that comes from attempting to build executables which serve no purpose in this environment. The library itself does not require an access implementation and the binaries which do should not be built.

That's not to say that access should not be implemented it's just that the correct solution for the issue you reported is to patch the libpng build process to prevent building of problematic executables. Those binaries will be compiled to run on bare-metal powerpc-eabi but will be installed on your build system where they cannot be executed and may cause problems.

_________________
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog


Tue Apr 04, 2017 11:09 pm
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads