Discussion:
[OpenOCD-devel] Issues compiling from git on CentOS 6.6
Borton, Nick
2017-06-29 19:40:32 UTC
Permalink
Hello,

I'm attempting to build OpenOCD from the git source on CentOS 6.6

I downloaded the source with the following: git clone https://git.code.sf.net/p/openocd/code openocd-code

Then ran the following:
./bootstrap
./configure --prefix=${PREFIX}
make all install

I am currently getting the following error:

libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function `mips32_checksum_memory':
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32.o): In function `mips32_blank_check_memory':
mips32.c:(.text+0x2490): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function `mips32_pracc_clean_text_jump':
mips32_pracc.c:(.text+0x269): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function `mips32_pracc_fastdata_xfer':
mips32_pracc.c:(.text+0x2f2c): undefined reference to `pracc_swap16_array'
mips32_pracc.c:(.text+0x3099): undefined reference to `pracc_swap16_array'
collect2: ld returned 1 exit status

I'm assuming there is something silly I have wrong?

Thanks,

Nick
Borton, Nick
2017-06-29 19:49:17 UTC
Permalink
Hello,

I'm attempting to build OpenOCD from the git source on CentOS 6.6

I downloaded the source with the following: git clone https://git.code.sf.net/p/openocd/code openocd-code

Then ran the following:
./bootstrap
./configure --prefix=${PREFIX}
make all install

I am currently getting the following error:

libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function `mips32_checksum_memory':
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32.o): In function `mips32_blank_check_memory':
mips32.c:(.text+0x2490): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function `mips32_pracc_clean_text_jump':
mips32_pracc.c:(.text+0x269): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function `mips32_pracc_fastdata_xfer':
mips32_pracc.c:(.text+0x2f2c): undefined reference to `pracc_swap16_array'
mips32_pracc.c:(.text+0x3099): undefined reference to `pracc_swap16_array'
collect2: ld returned 1 exit status

I'm assuming there is something silly I have wrong?

Thanks,

Nick
Freddie Chopin
2017-06-29 21:57:04 UTC
Permalink
Post by Borton, Nick
Hello,
I’m attempting to build OpenOCD from the git source on CentOS 6.6
I downloaded the source with the following: git clone https://git.cod
e.sf.net/p/openocd/code openocd-code
./bootstrap
./configure --prefix=${PREFIX}
make all install
libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-
security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast
-Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o
src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x2490): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x269): undefined reference to
`pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x2f2c): undefined reference to
`pracc_swap16_array'
mips32_pracc.c:(.text+0x3099): undefined reference to
`pracc_swap16_array'
collect2: ld returned 1 exit status
I’m assuming there is something silly I have wrong?
I've just tried that and the code build fine (apart from several GCC7-
only warnings - see http://openocd.zylin.com/#/c/4174/ and
http://openocd.zylin.com/#/c/4175/). Show us what you get from `git
status` - maybe there are some strange files in your repository.

Regards,
FCh
Borton, Nick
2017-07-05 19:32:56 UTC
Permalink
It does not appear that I have anything weird in the repo:

$ git status
# On branch master
nothing to commit (working directory clean)

Maybe my old version of GCC is the issue:
$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)

-----Original Message-----
From: Freddie Chopin [mailto:***@op.pl]
Sent: Thursday, June 29, 2017 5:57 PM
To: openocd-***@lists.sourceforge.net
Subject: Re: [OpenOCD-devel] Issues compiling from git on CentOS 6.6

Notice: This message originated outside of SRC.
Post by Borton, Nick
Hello,
I’m attempting to build OpenOCD from the git source on CentOS 6.6
I downloaded the source with the following: git clone https://git.cod
e.sf.net/p/openocd/code openocd-code
./bootstrap
./configure --prefix=${PREFIX}
make all install
libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-
security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast
-Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o
src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x2490): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x269): undefined reference to
`pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x2f2c): undefined reference to
`pracc_swap16_array'
mips32_pracc.c:(.text+0x3099): undefined reference to
`pracc_swap16_array'
collect2: ld returned 1 exit status
I’m assuming there is something silly I have wrong?
I've just tried that and the code build fine (apart from several GCC7- only warnings - see http://openocd.zylin.com/#/c/4174/ and http://openocd.zylin.com/#/c/4175/). Show us what you get from `git status` - maybe there are some strange files in your repository.

Regards,
FCh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
OpenOCD-devel mailing list
OpenOCD-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel
s***@nixia.no
2017-07-06 07:37:07 UTC
Permalink
Post by Borton, Nick
libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-
security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast
-Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o
src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32.o): In function
mips32.c:(.text+0x2490): undefined reference to `pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x269): undefined reference to
`pracc_swap16_array'
src/.libs/libopenocd.a(mips32_pracc.o): In function
mips32_pracc.c:(.text+0x2f2c): undefined reference to
`pracc_swap16_array'
mips32_pracc.c:(.text+0x3099): undefined reference to
`pracc_swap16_array'
collect2: ld returned 1 exit status
I’m assuming there is something silly I have wrong?
The failing symbols are declared inline in a header file; and inline
functions in header files are scary, since different versions of the C
standard have different rules about them in if you want the compiler to
able to choose about inline them or not (in your compilation, the
compiler has chosen not to inline them, and the linker is unable to find
a non-inline version of the function, since there is not created one).

http://www.greenend.org.uk/rjk/tech/inline.html

currently the code has almost done strategy 3, but missing one "extern"
in a .c file. Easiest and most common is strategy 1, adding the static
keyword.

--
Stian Skjelstad
Andreas Fritiofson
2017-07-06 07:55:18 UTC
Permalink
Post by Borton, Nick
libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-security
-Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align
-Wredundant-decls -Werror -o src/openocd src/main.o src/.libs/libopenocd.a
./jimtcl/libjim.a -ldl
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'
Can you please try and see if http://openocd.zylin.com/4178 fixes the issue?

/Andreas
Borton, Nick
2017-07-06 17:22:04 UTC
Permalink
Andreas,

I pulled that fix in and OpenOCD built properly.

Thanks for the help,

Nick

From: ***@fritiofson.net [mailto:***@fritiofson.net] On Behalf Of Andreas Fritiofson
Sent: Thursday, July 06, 2017 3:55 AM
To: Borton, Nick <***@srcinc.com>
Cc: openocd-***@lists.sourceforge.net
Subject: Re: [OpenOCD-devel] Issues compiling from git on CentOS 6.6

Notice: This message originated outside of SRC.


On Thu, Jun 29, 2017 at 5:29 PM, Borton, Nick <***@srcinc.com<mailto:***@srcinc.com>> wrote:

I am currently getting the following error:

libtool: link: gcc -std=gnu99 -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o src/openocd src/main.o src/.libs/libopenocd.a ./jimtcl/libjim.a -ldl
src/.libs/libopenocd.a(mips32.o): In function `mips32_checksum_memory':
mips32.c:(.text+0x20fd): undefined reference to `pracc_swap16_array'


Can you please try and see if http://openocd.zylin.com/4178 fixes the issue?

/Andreas

Loading...