# SHC Compiler \[ERROR\] AIX

**URL:** <https://community.unix.com/t/shc-compiler-error-aix/253034>\
**Category:** Shell Programming and Scripting\
**Created:** [November 6, 2009, 9:28am UTC](https://community.unix.com/t/shc-compiler-error-aix/253034 "2009-11-06T09:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![micrinho](https://community.unix.com/letter_avatar/micrinho/32/6_22734026db12803ebb3e059622ac3534.png) [@micrinho](https://community.unix.com/u/micrinho)\
**Post date:** [November 6, 2009, 9:28am UTC](https://community.unix.com/t/shc-compiler-error-aix/253034/1 "2009-11-06T09:28:34Z")

</div>

Hello there,

I�m compiling a shell script under UNIX AIX 5.3 operating system.

I�m facing a �glitch� when I tried to run the .x file AIX sent the error message �Killed�.

```nohighlight
# rpm -qa 
libgcc-4.2.0-3
libstdc++-4.2.0-3
gcc-4.2.0-3
libstdc++-devel-4.2.0-3
gcc-c++-4.2.0-3

# make
*** �Do you want to probe shc with a test script?
*** Please try... make test
Target "all" is up to date.
 
# ./shc -v -r -f script
shc shll=ksh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc script.x.c -o script.x
shc: strip script.x
shc: chmod go-r script.x
 
# ./script.x
Killed
 
# echo $? 
137
This error is a signal 9
 
# type gcc
gcc is /usr/bin/gcc
 
# type cc
cc is /usr/bin/cc

```

Does anyone have any idea about that?  
Thanks a lot

---------- Post updated at 12:28 PM ---------- Previous update was at 11:30 AM ----------

All,

I put the command make clean and run make again and after make test, take a look the output:

```nohighlight
# make test
*** Compiling script "match"
 CFLAGS="-Wall -O6 -pedantic" ./shc -v -f match
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc -Wall -O6 -pedantic match.x.c -o match.x
match.x.c:113: warning: string length '1043' is greater than the length '509' ISO C90 compilers are required to support
shc: strip match.x
shc: chmod go-r match.x
*** Running a compiled test script!
*** It must show files with substring "sh" in your PATH...
 ./match.x sh
make: The signal code from the last command is 9.

Stop.

```

Thanks!!!

---

<div class="post-metadata">

**Author:** ![micrinho](https://community.unix.com/letter_avatar/micrinho/32/6_22734026db12803ebb3e059622ac3534.png) [@micrinho](https://community.unix.com/u/micrinho)\
**Post date:** [November 25, 2009, 9:13am UTC](https://community.unix.com/t/shc-compiler-error-aix/253034/2 "2009-11-25T09:13:46Z")

</div>

🆒Well, after a lot of research the problem was resolved !!! 😉

I installed in an AIX 5.3 32bits and it worked perfectly.

When installed on AIX 64bits something can not interpret the function TRACEABLE on software.

1 - Install and run the program generating the binary:

```nohighlight
$./shc -v -r -f test
shc shll = ksh
shc [-i] =- c
shc [-x] = exec '% s' "$ @"
shc [-l] =
shc opts =
shc: cc teste.x.c it teste.x
shc: strip teste.x
shc: chmod go-r teste.x

```

2 - Run the binary generated, will give the error (Killed) 😕 :eek:

```nohighlight
$./teste.x
Killed

```

- To work I deleted the option traceable, the possibility of trying to scan the script to check its contents.

- Taking this option is not possible to scan the generated script teste.x.

- In the script generated in C teste.x.c, draw the following lines (at end of file) 😉 :

```nohighlight
#if !TRACEABLE
        untraceable(argv[0]);
#endif

```

- Now run the command to build again in the file C teste.x:

```nohighlight
$ cc teste.x.c -o teste.x

```

- Running the script again teste.x generated: 😃 :rolleyes:

```nohighlight
$./teste.x
SOFTWARE TESTING SHC!

```

- It worked!! :b:

Thanks for help Marcelo Ramos from IBM.

= Jefferson Lima Aredes =

---

<div class="post-metadata">

**Author:** ![sakam\_me](https://community.unix.com/letter_avatar/sakam_me/32/6_22734026db12803ebb3e059622ac3534.png) [@sakam\_me](https://community.unix.com/u/sakam_me)\
**Post date:** [April 26, 2010, 12:31pm UTC](https://community.unix.com/t/shc-compiler-error-aix/253034/3 "2010-04-26T12:31:28Z")

</div>

Hi,

You could use "shc -T -f test",It works fine in AIX 5.3

Regards,  
Sam
