Hi, Don.

If you add the option -V to sdcc you will see the commands it executes
to run external commands (gpasm and gplink). I suspect you may be
mixing different versions.

I'm compiling this way:

$ SDCC_DIR=/public/salo/pic/sdcc-svn/pic14-r11327
$ SDCC="$SDCC_DIR/bin/sdcc --use-non-free --nostdinc 
-I$SDCC_DIR/device/include/pic14 -I$SDCC_DIR/device/non-free/include/pic14 
--nostdlib -L$SDCC_DIR/device/lib/build/pic14 
-L$SDCC_DIR/device/non-free/lib/build/pic14"
$ $SDCC -mpic14 -p16f1825 test2.c

The options --nostdlib and -L... tell gplink where to look for libraries.
Be sure it takes the libraries built from the pic14 branch.





El Fri, 26 Jul 2019 10:39:58 -0400
Don Wooton <dtwoo...@gmail.com> escribió:

> I have a newer gpasm than you.
> 
> gpasm --version
> gpasm-1.5.2 #1319 (Jul 18 2019)
> 
> The test2.c file is exactly as you sent it.
> 
> /home/don/c/pic/sdcc/branchTest/testInstall/bin/sdcc --version
> SDCC : pic14 3.9.2 #11327 (Linux)
> published under GNU General Public License (GPL)
> 
> /home/don/c/pic/sdcc/branchTest/testInstall/bin/sdcc \
>     --use-non-free -mpic14 -p16f1825 --nostdinc \
>     -I/home/don/c/pic/sdcc/branchTest/testInstall/share/sdcc/include/pic14 \
>     
> -I/home/don/c/pic/sdcc/branchTest/testInstall/share/sdcc/non-free/include/pic14
>  \
>     test2.c
> message: Using default linker script 
> "/usr/local/share/gputils/lkr/16f1825_g.lkr".
> error: Duplicate symbol "_main" defined in "test2.o" and "libsdcce_a-idata.o".
> warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0018] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x001C] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0018] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x001C] has no section. (pass 0)
> error: Error while writing hex file.
> 
> --------------------
> 
> /usr/local/bin/sdcc --version
> SDCC : 
> mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15
>  3.9.2 #11326 (Linux)
> published under GNU General Public License (GPL)
> 
> /usr/local/bin/sdcc \
>     --use-non-free -mpic14 -p16f1825 --nostdinc \
>     -I/usr/local/share/sdcc/include/pic14 \
>     -I/usr/local/share/sdcc/non-free/include/pic14 \
>     test2.c
> message: Using default linker script 
> "/usr/local/share/gputils/lkr/16f1825_g.lkr".
> warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0018] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x001C] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x0018] has no section. (pass 0)
> warning: Relocation symbol "_cinit" [0x001C] has no section. (pass 0)
> 
>     - Don
> 
> On Jul 26, Gonzalo Pérez de Olaguer Córdoba propounded certain bytes, to wit:
> > Subject: Re: [Sdcc-user] pic14 users: Please test the pic14 branch!
> >
> > Hi, Don.
> > 
> > El Wed, 24 Jul 2019 20:08:09 -0400
> > Don Wooton <dtwoo...@gmail.com> escribió:
> >   
> > > [...]
> > > I was not so successful with _INTCONbits.  Maybe I did not do it 
> > > correctly?  
> > 
> > You did it right. All the variations you tried work for me.
> > Maybe the difference is this:
> > 
> > $ gpasm --version
> > gpasm-1.5.0 #1285 (May 29 2019)
> > 
> > What version of gputils are you using?
> >   
> > > Manually adding extern _INTCONbit into main.asm in the correct
> > > section did work but would be rather a pain to automate.  
> > 
> > Please try the attached file test2.c
> > 
> > In case of failure, please post the C file and the resulting
> > assembly file.
> > 
> > -- 
> >    Gonzalo Pérez de Olaguer Córdoba       s...@gpoc.es
> >   -=- buscando empleo desde 1988 -=-       www.gpoc.es 
> > 
> > PGP: 3F87 CCE7 8B35 8C06 E637  2D57 5723 9984 718C A614  
> 
> > #include "pic16f1825.h"
> > 
> > typedef unsigned int config_word_t; 
> > static __code config_word_t __at _CONFIG1 config1Reg = 0x01;
> > static __code config_word_t __at _CONFIG2 config2Reg = 0x01;
> > 
> > 
> > #define disableIntr() \
> >     (void)INTCONbits; \
> >     __asm                                           __endasm; \
> >     __asm   bcf   _INTCONbits,7     ; disableIntr() __endasm; \
> >     __asm   btfsc _INTCONbits,7                     __endasm; \
> >     __asm   goto  $-2                               __endasm; \
> >     __asm                                           __endasm
> > 
> > #define enableIntr() \
> >     __asm                                           __endasm; \
> >     __asm   bsf   _INTCONbits,7     ; enableIntr()  __endasm; \
> >     __asm                                           __endasm
> > 
> > void main(void)
> > {
> >     disableIntr();
> > 
> >     enableIntr();
> > }
> >   
> 
> 
> > _______________________________________________
> > Sdcc-user mailing list
> > Sdcc-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sdcc-user  
> 
> >-- End of excerpt from Gonzalo Pérez de Olaguer Córdoba'  
> 
> 
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user


-- 
   Gonzalo Pérez de Olaguer Córdoba       s...@gpoc.es
  -=- buscando empleo desde 1988 -=-       www.gpoc.es 

PGP: 3F87 CCE7 8B35 8C06 E637  2D57 5723 9984 718C A614


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to