[#6632] undefined reference to `_swapon'

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6632] undefined reference to `_swapon'

Submitted By: Jeff Liu

Open Date

2011-06-10 02:30:29     Close Date

2011-06-10 10:23:51

Priority:

High     Assignee:

Nobody

Board:

N/A     Silicon Revision:

Resolution:

Rejected     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

toolchain rev.:

    kernel rev.:

State:

Closed     Found In Release:

N/A

Is this bug repeatable?:

yes     

Summary: undefined reference to `_swapon'

Details:

 

$ cat swap.c

#include <sys/swap.h>

#include <stdio.h>

 

int main(int argc, const char *argv[])

{

    char *path="/dev/";

 

    printf("haha");

    swapon(path, 0);

    return 0;

}

 

$ bfin-linux-uclibc-gcc swap.c

bfin-linux-uclibc-gcc swap.c

/tmp/cc18aFYi.o: In function `_main':

swap.c:(.text+0x24): undefined reference to `_swapon'

collect2: ld returned 1 exit status

---------------------------------------------------------------------

 

#I have tried this:

$ bfin-linux-uclibc-readelf -s /opt/toolchain/blackfin/bfin-linux-uclibc/runtime/lib/libc.so.0 | grep swapon

$ echo $?

1

 

---------------------------------------------------

#debug info

$ bfin-linux-uclibc-gcc -v

Using built-in specs.

Target: bfin-linux-uclibc

Configured with: /home/jeff/lab/blackfin/toolchain/gcc-4.3/configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=bfin-linux-uclibc --prefix=/opt/toolchain/blackfin --disable-libstdcxx-pch --with-sysroot=/opt/toolchain/blackfin/bfin-linux-uclibc/runtime --enable-threads=posix --enable-shared --enable-clocale=generic --disable-symvers --disable-libssp --disable-libffi --disable-libgcj --enable-version-specific-runtime-libs --enable-__cxa_atexit --with-bugurl=URL:http://blackfin.uclinux.org/gf/project/toolchain/tracker --with-pkgversion=ADI-trunk/git-79a71b4

Thread model: posix

gcc version 4.3.5 (ADI-trunk/git-79a71b4

 

 

Follow-ups

 

--- Mike Frysinger                                           2011-06-10 10:23:33

swap requires virtual memory which the Blackfin does not have.  so dont bother

trying to use it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes