Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3189 closed defect (fixed)

rev . 8414 desn't compile on SH4

Reported by: Netview Owned by:
Priority: Please fill in Component: ! Please select...
Severity: Please fill in Keywords:
Cc: Sensitive: no

Description

CC cscrypt/sha1.c
In file included from cscrypt/sha1.h:2,

from cscrypt/sha1.c:1:

/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:109: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:111: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:116: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:118: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:138: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:140: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:142: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:144: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:185: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:187: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:189: Fehler: expected declaration specifiers or »...« before »size_t«
/home/share/oscam-svn/external_LIBS/SH4-STAPI/include/openssl/sha.h:191: Fehler: expected declaration specifiers or »...« before »size_t«
make[1]: * [lib/libcscrypt-sh4-linux-stapi.a(cscrypt/sha1.o)] Fehler 1
make: [cross-sh4-linux-stapi] Fehler 2 (ignoriert)

Attachments (2)

globals.h.patch (377 bytes ) - added by Netview 9 years ago.
sha1.h.patch (283 bytes ) - added by Netview 9 years ago.

Download all attachments as: .zip

Change History (27)

comment:1 by Netview, 9 years ago

solution: revert changes in sha1.h (go back to 7175)
and add the following lines in globals.h

#if defined(WITH_SSL)
defined(WITH_LIBCRYPTO)

#include <openssl/aes.h>
#include <openssl/bn.h>
#else
#include "cscrypt/aes.h"
#include "cscrypt/bn.h"
#endif

instead of

#include "cscrypt/aes.h"
#include "cscrypt/bn.h"

by Netview, 9 years ago

Attachment: globals.h.patch added

comment:2 by Gorgone Impertinence, 9 years ago

Resolution: worksforme
Status: newclosed
             _                            _                         _
         ___| |_ _ __ ___  __ _ _ __ ___ | |__   ___   __ _ _ __ __| |
        / __| __| '__/ _ \/ _` | '_ ` _ \| '_ \ / _ \ / _` | '__/ _` |
        \__ \ |_| | |  __/ (_| | | | | | | |_) | (_) | (_| | | | (_| |
        |___/\__|_|  \___|\__,_|_| |_| |_|_.__/ \___/ \__,_|_|  \__,_|

        [ buildtime 0 min(s) 3 secs (Sa 23. Feb 13:00:46 CET 2013) ]

        oscam-svn8414-sh4-webif-ssl-stapi       
        found_in /opt/simplebuild2/archiv/


no problem stapi + ssl

Last edited 9 years ago by Gorgone Impertinence (previous) (diff)

comment:3 by gf, 9 years ago

I'm building pretty much of all of our supported architectures and there is not problem.

Judging by SH4-STAPI directory you are not using oscam sources as they are in oscam-svn. Please fix whatever build script you are using, because there is no such problem in oscam currently. Oh and a suggestion don't use the broken "build" script you are using.

Last edited 9 years ago by gf (previous) (diff)

comment:4 by Netview, 9 years ago

try it again using openssl than you will see what the problem is!

comment:5 by Netview, 9 years ago

This is what I have replaced in globals.h (sha1.h didn't need to be touched!):

#if defined(WITH_SSL)
defined(WITH_LIBCRYPTO)

#include <openssl/aes.h>
#include <openssl/bn.h>
#else
#include "cscrypt/aes.h"
#include "cscrypt/bn.h"
#endif

instead of

#include "cscrypt/aes.h"
#include "cscrypt/bn.h"

comment:6 by Netview, 9 years ago

some characters are garbled - look into globals.h.patch

comment:7 by Netview, 9 years ago

Resolution: worksforme
Status: closedreopened

comment:8 by gf, 9 years ago

Resolution: invalid
Status: reopenedclosed

I have tried using openssl how do you think I test patches that change header dependencies. If you can't replicate this using make USE_STAPI=1 USE_LIBCRYPTO=1 CROSS=sh4-linux- you are wasting our time. Please do tell us, what script are you using, and why are you not complaining to the script author?

Also your globals.h patch is wrong, and you can see why it is wrong by looking into
csctapi/aes.h and csctapi/bn.h (the first 5 lines of each of the headers). Here are the links.
http://www.streamboard.tv/oscam/browser/trunk/cscrypt/aes.h
http://www.streamboard.tv/oscam/browser/trunk/cscrypt/bn.h
http://www.streamboard.tv/oscam/browser/trunk/cscrypt/sha1.h

Please stop wasting our time.

Last edited 9 years ago by gf (previous) (diff)

comment:9 by gf, 9 years ago

And another proof that your source have been patched and the problem is at your side. sha1.h is used only in module-cccam.c and it is included after globals.h which includes all needed system headers.

comment:10 by Netview, 9 years ago

I found the problem! If sha1.h is used only in module-cccam.c why you have include it in sha1.c (first line). If I delete #include "sha1.h" in "sha1.c" my problem is solved without changing "globals.h".

comment:11 by Netview, 9 years ago

Resolution: invalid
Status: closedreopened

comment:12 by gf, 9 years ago

If you are not going to do what I have asked you to do (show me that the error exist in normal oscam build without any scripts that you are using) you can reopen the ticket as much as you want, I'm not going to help you.

comment:13 by gf, 9 years ago

Here is my log, where is yours?

gf@gf:~/git/oscam$ make sh4-stapi USE_LIBCRYPTO=1
make --no-print-directory \
	CROSS=sh4-linux- \
	CONF_DIR=/var/tuxbox/config \
	USE_STAPI=1 \
	USE_LIBCRYPTO=1
+-------------------------------------------------------------------------------
| OSCam ver: 1.20-unstable_svn rev: 8414 target: sh4-linux-stapi
| Tools:
|  CROSS    = sh4-linux-
|  CC       = sh4-linux-gcc
| Settings:
|  CONF_DIR = /var/tuxbox/config
|  CC_OPTS  = -O2 -ggdb -pipe -ffunction-sections -fdata-sections
|  CC_WARN  = -W -Wall -Wshadow -Wredundant-decls -Wstrict-prototypes -Wold-style-definition
|  CFLAGS   = -DWITH_STAPI=1 -DWITH_LIBCRYPTO=1
|  LDFLAGS  = -Wl,--gc-sections -DWITH_STAPI=1 -DWITH_LIBCRYPTO=1
|  LIBS     = -L./stapi -loscam_stapi -lcrypto -lpthread -ldl
|  UseFlags = USE_STAPI=1 USE_LIBCRYPTO=1
| Config:
|  Addons   : WEBIF TOUCH HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CW_CYCLE_CHECK
|  Protocols: CAMD35 CAMD35_TCP NEWCAMD CCCAM CCCSHARE GBOX RADEGAST SERIAL CONSTCW PANDORA
|  Readers  : NAGRA IRDETO CONAX CRYPTOWORKS SECA VIACCESS VIDEOGUARD DRE TONGFANG BULCRYPT GRIFFIN DGCRYPT
|  CardRdrs : PHOENIX INTERNAL SC8IN1 MP35 SMARGO DB2COM STAPI
|  Compiler : sh4-linux-gcc (GCC) 4.2.4 (snapshot) (STMicroelectronics/Linux Base 4.2.4-71)
|  Binary   : Distribution/oscam-1.20-unstable_svn8414-sh4-linux-stapi
+-------------------------------------------------------------------------------
CC	cscrypt/des.c
CC	cscrypt/i_cbc.c
CC	cscrypt/i_ecb.c
CC	cscrypt/i_skey.c
CC	cscrypt/md5.c
CC	cscrypt/rc6.c
CC	csctapi/atr.c
CC	csctapi/icc_async.c
CC	csctapi/io_serial.c
CC	csctapi/protocol_t0.c
CC	csctapi/protocol_t1.c
CC	csctapi/ifd_db2com.c
CC	csctapi/ifd_mp35.c
CC	csctapi/ifd_phoenix.c
CC	csctapi/ifd_sc8in1.c
CC	csctapi/ifd_sci.c
CC	csctapi/ifd_smargo.c
CC	csctapi/ifd_stapi.c
CC	minilzo/minilzo.c
CC	module-anticasc.c
CC	module-cacheex.c
CC	module-camd35.c
CC	module-cccam.c
CC	module-cccshare.c
CC	module-constcw.c
CC	module-csp.c
CC	module-cw-cycle-check.c
CC	module-dvbapi-stapi.c
CC	module-dvbapi.c
CC	module-gbox.c
CC	module-ird-guess.c
CC	module-monitor.c
CC	module-newcamd.c
CC	module-pandora.c
CC	module-radegast.c
CC	module-serial.c
CC	module-stat.c
CC	module-webif.c
CC	module-webif-lib.c
CC	module-webif-pages.c
CC	reader-common.c
CC	reader-bulcrypt.c
CC	reader-conax.c
CC	reader-cryptoworks.c
CC	reader-dgcrypt.c
CC	reader-dre.c
CC	reader-griffin.c
CC	reader-irdeto.c
CC	reader-nagra.c
CC	reader-seca.c
CC	reader-tongfang.c
CC	reader-viaccess.c
CC	reader-videoguard-common.c
CC	reader-videoguard1.c
CC	reader-videoguard12.c
CC	reader-videoguard2.c
CC	oscam-aes.c
CC	oscam-chk.c
CC	oscam-client.c
CC	oscam-conf.c
CC	oscam-conf-chk.c
CC	oscam-conf-mk.c
CC	oscam-config-account.c
CC	oscam-config-global.c
CC	oscam-config-reader.c
CC	oscam-config.c
CC	oscam-ecm.c
CC	oscam-emm.c
CC	oscam-failban.c
CC	oscam-files.c
CC	oscam-garbage.c
CC	oscam-lock.c
CC	oscam-log.c
CC	oscam-log-reader.c
CC	oscam-net.c
CC	oscam-llist.c
CC	oscam-reader.c
CC	oscam-simples.c
CC	oscam-string.c
CC	oscam-time.c
CC	oscam-work.c
CC	oscam.c
CONF	build/sh4-linux-stapi/config.c
LINK	Distribution/oscam-1.20-unstable_svn8414-sh4-linux-stapi.debug
STRIP	Distribution/oscam-1.20-unstable_svn8414-sh4-linux-stapi

comment:14 by Netview, 9 years ago

Sorry - but I think that including 'sha1.h' (first line) in 'sha1.c' is not needeed for compiling.

My environment differs from yours:
Compiler : sh4-linux-gcc (STMicroelectronics/Linux Base) 4.3.4 20091123
and I use my own scripts.

You know that different (newer) compiler-versions produces different warnings and error-messages?!
So maybe this could be the problem!

But anyway, I have fixed it!

comment:15 by yop, 9 years ago

Thank you Netview, that is indeed the reason it was failing to compile also for mipsel (OE2.0).
BTW in my case it was failing without USE_LIBCRYPTO, I never use that make option.

EDIT: Let me be more precise, removing the include in sha1.c of the sha1.h was the solution, haven't seen or tested the initial patch.

Last edited 9 years ago by yop (previous) (diff)

comment:16 by Netview, 9 years ago

@gf: would you please show me that 'sha1.h' must be included in 'sha1.c' to build oscam?

that's what you wrote:

... sha1.h is used only in module-cccam.c and it is included after globals.h which includes all needed system headers.

comment:17 by hapeba, 9 years ago

here also ...
build oscam-server (8414-sh4) without libusb ...
make: * Keine Regel, um »clean« zu erstellen. Schluss.
In file included from /home/oscam/oscam-threaded-test/cscrypt/sha1.h:2,

from /home/oscam/oscam-threaded-test/cscrypt/sha1.c:1:

/home/oscam/toolchains/sh4/include/openssl/sha.h:109: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:111: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:116: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:118: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:138: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:140: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:142: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:144: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:185: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:187: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:189: Fehler: expected declaration specifiers or »...« before »size_t«
/home/oscam/toolchains/sh4/include/openssl/sha.h:191: Fehler: expected declaration specifiers or »...« before »size_t«
make[2]: * [cscrypt/CMakeFiles/cscrypt.dir/sha1.o] Fehler 1
make[1]:
* [cscrypt/CMakeFiles/cscrypt.dir/all] Fehler 2
make: * [all] Fehler 2

comment:18 by Netview, 9 years ago

@to all: the patch isn't needed. Delete the first line of sha1.c: "#include "sha1.h".
This is misplaced.

comment:19 by gabberhead, 9 years ago

i get also error on compile. mipsel an i686 works only sh4 makes problems
[ 98%] Building C object cscrypt/CMakeFiles/cscrypt.dir/bn_shift.o
[ 99%] Building C object cscrypt/CMakeFiles/cscrypt.dir/sha1.o
In file included from /root/oscam-sh4/cscrypt/sha1.h:2,

from /root/oscam-sh4/cscrypt/sha1.c:1:

/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:109: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:111: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:116: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:118: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:138: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:140: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:142: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:144: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:185: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:187: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:189: error: expected declaration specifiers or â...â before âsize_tâ
/tdt/tdt/tufsbox/cdkroot/usr/include/openssl/sha.h:191: error: expected declaration specifiers or â...â before âsize_tâ
make[2]: * [cscrypt/CMakeFiles/cscrypt.dir/sha1.o] Fehler 1
make[1]:
* [cscrypt/CMakeFiles/cscrypt.dir/all] Fehler 2
make: * [all] Fehler 2
mv: der Aufruf von stat für »oscamâ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
mv: der Aufruf von stat für »oscam.sh4â ist nicht möglich: Datei oder Verzeichnis nicht gefunden

in reply to:  16 comment:20 by gf, 9 years ago

Replying to Netview:

@gf: would you please show me that 'sha1.h' must be included in 'sha1.c' to build oscam?

that's what you wrote:

... sha1.h is used only in module-cccam.c and it is included after globals.h which includes all needed system headers.

Of course it have to be included. From where otherwise sha1.c would get SHA1_CTX and SHA_DIGEST_LEN definitions in case the build does not use LIBCRYPTO?

comment:21 by hapeba, 9 years ago

also not build: SH4-Stapi, Mipsel-WDTV und Coolstream

comment:22 by dropsman, 9 years ago

I have NO problems with the last changes from gf. Build server x86 (i386, i586 and i686) and clients for mipsel, mipsel oe2.0, mipsel with hard float option, ppc_old, sh4 and also sh4_stapi.

NO PROBLEMS.

I use 'make' to compile the binaries.

Last edited 9 years ago by dropsman (previous) (diff)

comment:23 by Netview, 9 years ago

Maybe it is a open_ssl Problem. I found this:

The following trivial C file fails to compile in 0.9.8a:

#include <openssl/sha.h>

void
foo(void)
{
}

In file included from test.c:1:
/usr/include/openssl/sha.h:109: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:111: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:116: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:118: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:138: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:140: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:142: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:144: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:185: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:187: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:189: error: syntax error before 'size_t'
/usr/include/openssl/sha.h:191: error: syntax error before 'size_t'

This did not appear to happen in 0.9.7. Probably this is due to
changing the API to use size_t; in sha.h

Last edited 9 years ago by Netview (previous) (diff)

by Netview, 9 years ago

Attachment: sha1.h.patch added

comment:24 by Netview, 9 years ago

This patch will work with > openssl-0.9.7.
You do not have to change sha1.c or whatever!
For openssl > 0.9.7 you have to add 'stdddef.h' in front of 'sha.h'.

sha1.h:

#if defined(WITH_SSL)
defined(WITH_LIBCRYPTO)

# include <stddef.h>
# include <openssl/sha.h>
#else
/* public api for steve reid's public domain SHA-1 implementation */
/* this file is in the public domain */
...

patch: sha1.h.patch

@gf: could you please test this patch?
Maybe this will work also with < openssl-0.9.8?

Last edited 9 years ago by Netview (previous) (diff)

comment:25 by gf, 9 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in r8416. Next time, just post full build log. It seems your openssl headers are broken, they should include <stddef.h> (for size_t) by themselves since they appear to be using it. Also the stupid cmake should not be build sha1.c at all when libcrypto support is enabled.

Last edited 9 years ago by gf (previous) (diff)
Note: See TracTickets for help on using tickets.